Hi,
I have a text file with each line having variable number of words..
how do i print the first few words and last word of a line in to an output file.
I was doing with $NF for the last feild in shell scripts how do i do it in perl.
sample text file
====================
hgahgdhsgd hgshdgshd jhkjjkj lklk 9898
ghsgh t6523 8787 87jhj jhjshjhh
jjkjkj hjhjjhh 0000
i would like first few words and the last word in an output file to process further.
Thanks
Rao
I have a text file with each line having variable number of words..
how do i print the first few words and last word of a line in to an output file.
I was doing with $NF for the last feild in shell scripts how do i do it in perl.
sample text file
====================
hgahgdhsgd hgshdgshd jhkjjkj lklk 9898
ghsgh t6523 8787 87jhj jhjshjhh
jjkjkj hjhjjhh 0000
i would like first few words and the last word in an output file to process further.
Thanks
Rao