Hi PerlMonks, I have a great batch perl command line script: http://www.unix.com/members/302084659.html by k_manimuthu that does almost exactly what I need running in OSX terminal:
perl -i -pe 'BEGIN{undef $/;} s/^/\nFilename:$ARGV\n/' `find . -name '*.TXT'` However the files I'm picking up are UTF-16LE and the appended filename text being added to the front of the file is being outputted in UTF8. I have tried various things to print the filename in UTF-16LE, the closest that actually runs is: perl -i -pe 'BEGIN{binmode STDIN,":encoding(utf16le)"; undef $/;} s/^/\nFilename:$ARGV\n/' `find . -name '*.TXT'`however this still seems to output utf8. Can anyone improve k_manimuthu's little gem of a script? Thanks
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |