Question 1
Original:
First String Second 1.22 3.4
Second More Text 1.555555 2.2220
Third x 3 124
New:
First String,Second,1.22,3.4
Second,More Text,1.555555,2.2220
Third,x,3,124
How I did it:
I used the `\h` wildcard to find and select all the spaces and selected two or more consecutive spaces using {2,} follwing the `\h`
Question 2
Original:
Ballif, Bryan, University of Vermont
Ellison, Aaron, Harvard Forest
Record, Sydne, Bryn Mawr
New:
Ballif Bryan (University of Vermont)
Ellison Aaron (Harvard Forest)
Record Sydne (Bryn Mawr)
How I did it:
My input was `(\w+), (\w+), (.{2,})` and I listed captures 1 2 and then 3 inside of `\(\)` to add in the parentheses for the Universites
Question 3
Original:
0001 Georgia Horseshoe.mp3 0002 Billy In The Lowground.mp3 0003 Cherokee Shuffle.mp3 0004 Walking Cane.mp3
New:
0001 Georgia Horseshoe.mp3
0002 Billy In The Lowground.mp3
0003 Cherokee Shuffle.mp3
0004 Walking Cane.mp3
How I did it:
I want to convert the space following each song's file name to a new line, so I searched for the captured phrase (mp3) followed by `\s` to indicate the space and replaces it with \1\r to move each captured portion to a new line
Question 4
Original:
Georgia Horseshoe_0001.mp3
Billy In The Lowground_0002.mp3
Cherokee Shuffle_0003.mp3
Walking Cane_0004.mp3
New:
Georgia Horseshoe_.mp30001
Billy In The Lowground_.mp30002
Cherokee Shuffle_.mp30003
Walking Cane_.mp30004
How I did it:
I put `(.+)(\d{4})(.+)` into find to capture the portion in front and behind the four digit number I was trying to move and replaced it with `\1\3\2` to move that portion to the end.
Question 5
Original:
Camponotus,pennsylvanicus,10.2,44
Camponotus,herculeanus,10.5,3
Myrmica,punctiventris,12.2,4
Lasius,neoniger,3.3,55
New:
C_pennsylvanicus,44
C_herculeanus,3
M_punctiventris,4
L_neoniger,55
How I did it:
I captured the portions I wanted: the first letter of the genus, the species, and the second numerica value using `(\w).+,(\w*),.+(,\d+)` in find and replaced it with `\1_\2\3` to include in the underscore.
Question 6
Original:
same as Question 5
New:
C_penn,44
C_herc,3
M_punc,4
L_neon,55
How I did it:
I used a similar approach to Question 5, but in the second capture part I used `\w{4}` to select only the first four characters in the species. My total find statement was `(\w).+,(\w{4}).+,.+(,\d+)` and the replacement was the same as Question 5: `\1_\2\3`.
Question 7
Original:
same as Question 5
New:
Campen, 44, 10.2
Camher, 3, 10.5
Myrpun, 4, 12.2
Lasneo, 55, 3.3
How I did it:
Using the find tool I put in `(\w{3}).+,(\w{3}).+,(.+),(\d+)` and replaced it with `\1\2, \4, \3` to obtain the rearrangement above.
end Homework 3