Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #sed -i '1s/^/Name Phone Number Jan Feb Mar\n/' move1.txt
- #1) Insert a heading line as follows to the top of the file and output the resulting data to a file called move1.txt.
- #Name Phone Number Jan Feb Mar
- #2) Duplicate the file in a file called move2.txt, except replace the name Hauschild with Housechild
- #3) Put the list of donors (only their full name, no other data) with area code 916 in a file called move3.txt
- #4) Anyone who's first names start with a M or R should go into a file called move4.txt, but only their first names.
- #5) Find the people who donated over $500.00 in any month in the file move5.txt. For this, I just want their full name and phone number, but nothing else. This data should be sorted by their last name.
- #echo $"Name Phone Number Jan Feb Mar" >> move1.txt
- #echo $"Jane Smith, (314)314-123.\$10.00,\$50.00,\$15.00" >> move1.txt
- #echo $"Mark Hauschild, (916)-516-1234,\$5.00,\$75.00,\$25.25" >> move1.txt
- cp $1 move1.txt
- sed -i '1s/^/Name Phone Number Jan Feb Mar\n/' move1.txt
- #moving the contents of move1.txt to move2.txt
- cp move1.txt move2.txt
- #Replacing Hauschild with Housechild
- sed -i 's/Hauschild/Housechild/g' move2.txt
- #show area code with (916)
- grep '\(916\)' move2.txt | grep -o '^[^\,\]*' > move3.txt
- #sed -n '/\(916\)/p' move2.txt > move3.txt
- #Name Starting with M or R
- grep -E -o '^M.[^ ]*|^R.[^ ]*' move3.txt > move4.txt
- #grep -o '^[^ ]*' move3.txt > move4.txt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement