Perl one liners that can come in handy
This statement will modify "file.txt" by performing a search and replace and creating a backup of the original file called "file.txt.bak". The code below are formated for windows with double quotes ex: "/,//g", Linux uses single quotes ex: '/,//g'.
# Find all comma's "," and replace them with nothing "". perl -i.bak -pe "s/,//g" file.txt
# Change format of file from DOS to Unix perl -i.bak -pe "s/\r$//g" file.txt
# Change the format of a file from Unix to DOS perl -i.bak -pe "s/$/\r/g" file.txt
|