Here is how to do a search and replace using Perl regex over a set of files: perl -pi -e ‘s/source/destination/g’ *.ext
Archive for the ‘Regex’ Category
Another task which hits my desk often is getting “data” out of text files. Such as names, email addresses, phone numbers, ID numbers, etc. Here is a quick way to parse or rip out “data” from a text file. I suggest using ‘grep’ — grep is one of those applications which is more powerful than [...]
Parsing out email addresses is a tedious task. This task hits my desk on a consistent basis. Usually, in my case, the list is coming out of Outlook. If the target list is coming out of Outlook make sure you export using Tab Separated for DOS (thus, click on File–>Import/Export–>Export to a File–>Tab Separated (DOS)–>[select_the_target_folder]). [...]