flat file - Why won't Strawberry Perl remove these form feed characters? -
flat file - Why won't Strawberry Perl remove these form feed characters? -
i'm running strawberry perl on winxp, , i'm trying process unix-formatted flat file. flat file uses line feed characters delimit fields, , form feed characters delimit record. trying convert ff else (crlf, ';', tab, etc). have tried using next perl one-liners no success:
perl -p -e 's/\f/\r\n/g' < unix.txt > dos.txt perl -p -e 's/\x0c/\x0d\x0a/g' < unix.txt > dos.txt perl -p -e 's/\f/\t/g' < unix.txt > dos.txt
the thing i've noticed the dos.txt ends lf chars converted crlf, ff chars remain. i've tried reprocess dos.txt file, 1 time again trying replace ff, still no dice. still much perl newbie, maybe i'm missing something? know why above commands don't want them do?
the problem windows shell doesn't interpret single quotes way unix shell does. should utilize double quotes in commands.
c:\ perl -e "print qq/foo\fbar/" > test.txt c:\ type test.txt foo♀bar c:\ perl -pe 's/\f/__ff__/' < test.txt foo♀bar c:\ perl -pe "s/\f/__ff__/" < test.txt foo__ff__bar
perl flat-file strawberry-perl
Comments
Post a Comment