#!/usr/bin/perl -pi s/^\|/\\N\|/; s/\|\s*$/\|\\N/; s/\|\s*\|/\|\\N\|/g; s/\|\.\s*\|/\|\\N\|/g; s/\|\s+/\|/g; s/\s+\|/\|/g; s/(\d{2}:\d{2}:\d{2})\.\d+/$1/g; s/(\d{5})-(?:\d{1,4}|\s+)/$1/;
Should be very much more effective, because it creates new files instead of trying to move all the bytes in the file around for each substitution.
See perlrun's info on the -i and -p switches.
In reply to Re: Multiple substitutions in large files
by Joost
in thread Multiple substitutions in large files
by mdi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |