O Wise and Awesome Monks, a text file contains lines of fields seperated by some delimiter; space for example; some lines not all will have in field 2 a value like an inital (e.g., A. or B. or Jr.) for those lines with such a value in field 2, we wish to have that value removed or deleted. We also wish to do this as a one-line. Here's what we have so far. What say you?
c:\perl\bin\perl.exe -e "while (<>) { next if ($F[2] ~= /A-Za-z/\.;) print \"\"}" < text.txt > xt.txtor
c:\perl\bin\perl.exe -e -i.bak "while (<>) { next if ($F[2] ~= /A-Za-z/\.;) print \"\"}" text.txtIn reply to On Match Remove Field by rfransix
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |