dos2unix didn't work

Posted by admin Sun, 02 May 2010 16:47:00 GMT

Fine, then, we'll use Perl. OUTTA THA WAY!!!!!

Remove pesky windows carriage returns:
perl -pi.bak -e 's/\r/\n/g;' ./thefile

Posted in ,  | Tags , , , , , , ,  | no comments

Line 1: One-Liner

Posted by admin Sun, 02 May 2010 14:12:00 GMT

Turn a list into quoted comma separated values for a perl array:

perl -i.bak -ne 's/^(.*?)\n$/\"$1\",/;print' ./list_of_bare_strings



 



Oh,  but your list is just a bunch of filenames you copied from the output of 'ls' and you need them one-per-line:



printf "%s\n" $(>pasted_ls_output) < list_of_bare_strings

Posted in ,  | Tags , ,  | no comments | no trackbacks