in reply to ignore some delimiters while using split
assuming your file is named data.txt. If you want to save that to a second file thenperl -ne 'print if / (\S) \1 \1$/' data.txt
perl -ne 'print if / (\S) \1 \1$/' data.txt > second.file
The -ne flags are very handy at the command line. The -e flag means "evaluate this code". The -n flag doesn't have a convenient mnemonic but wraps a loop around the code for every line of input.
For example...
perl -e 'print "hello world\n"'
... is a nice canonical example. And...
perl -ne 'print "hello world. Look at this: $_"' data.txt
...will prepend text to every line of data.txt and print the result.
more docs for command line options at perlrun
more docs for regular expressions at perlre
|
|---|