Hi All!
I trying to execute this perl script to extract a particular field in a text file, luckily it works. But, right now I would to extract 3 more fields in the text file but couldnt get right syntax on how to do it.
command is: perl -pe '$_ = (split(/[ \n]/)) [0] . "\n"' TestDoc.txt ---> extracts only the first field in the text file.
Sample Data:
-f sss vvvv 6765 /etc/password 2011201 -f sss vvvv 7777 /usr/share 2011201 -f sss vvvv 8888 /home/bin 2011201
ANy help would be gladly appreciated. TIA.
I trying to execute this perl script to extract a particular field in a text file, luckily it works. But, right now I would to extract 3 more fields in the text file but couldnt get right syntax on how to do it.
command is: perl -pe '$_ = (split(/[ \n]/)) [0] . "\n"' TestDoc.txt ---> extracts only the first field in the text file.
Sample Data:
-f sss vvvv 6765 /etc/password 2011201 -f sss vvvv 7777 /usr/share 2011201 -f sss vvvv 8888 /home/bin 2011201
ANy help would be gladly appreciated. TIA.