Regular Expressions

1.

Find: [ \t]{2,} 
Replace: ,

Removing spaces and replacing them with commas

2.

Find:(\w+), (\w+), (.*) 
Replace: $2 $1 \($3\) 

captures the last name, first name, and affiliation, and adding parentheses

3.

Find: ^\s*(\d{4} .+?\.mp3)\s* 
Replace: $1\n 

Captures any leading space and the numbers, then matches any trailing spaces. Then replaces the matched text with the captured group followed by a newline character.

4.

Find: ^\s*(\d{4})\s(.+?)(\.mp3) 
Replace:$2_$1$3 

Captures the leading digit, and .mp3, then rearranges the captured groups into the new format

5.

Find:(\w)\w+?,(\w+),[\d\.]+,(\d+) 
Replace:$1_$2,$3 

Captures the first letter of the genus, species name, numerical value. Then rearranges genus initial, species name, and last number

6.

Find:(\w)\w+?,(\w{4})\w+?,[\d\.]+,(\d+) 
Replace:$1_$2,$3

Captures the first four letters of the species name

7.

Find: ^(\w{3})\w*,(\w{3})\w*,([\d\.]+),(\d+)$ 
Replace: $1$2, $4, $3 

Captures the first three letters of the genus and species name, and numerical value. Rearrange the sequence using the first three letters of genus and species names and then the numbers

8.From the .cvs file

Changing the NA for 0 to get a binary column

Find: ,NA,
Replace: ,0,

Removing all the extra characters

Find: [^\w\s,] 
Replace: with nothing 

Matches any character that is not a word character, space, or a comma

There are some spaces after some words

Find: ,(\w+)\s+, 
Replace:,$1, 

Matches a word followed by one or more space characters and a comma.Then remove the spaces and keep the word and commas