And in that vein, the following command should scan through a file and perform the operation on every line, leaving a backup with .bak appended. If this is Windows, change the single quotes to double quotes.
perl -pi.bak -e 's/\s*\|\s*/\|/g' filenameIn reply to Re^2: Extracting data from a pipe delimited text file
by Ionitor
in thread Extracting data from a pipe delimited text file
by mantra2006
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |