perlman:perlfaq5 - How do I change one line in a file/delete a line in a file/insert a line in the middle of a file/append to the beginning of a file?
There are of course one liners.....
# just delete the first char if it is ^M perl -pi.bak -e "$i++ || s/^\r//" <filenames> # delete the entire first line if it starts with ^M perl -pi.bak -e "$i++ || s/^\r.*\n//" <filenames>
PS use ' not " on *nix. Too much time on Win2K sigh
cheers
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
In reply to Re: control character at top of file
by tachyon
in thread control character at top of file
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |