How can I read lines from the end of file in Perl?

后端 未结 11 1955
夕颜
夕颜 2020-12-06 02:41

I am working on a Perl script to read CSV file and do some calculations. CSV file has only two columns, something like below.

One Two
1.00 44.000
3.00 55.000         


        
11条回答
  •  我在风中等你
    2020-12-06 03:24

    perl -n -e "shift @d if (@d >= 1000); push(@d, $_); END { print @d }" < bigfile.csv
    

    Although really, the fact that UNIX systems can simply tail -n 1000 should convince you to simply install cygwin or colinux

提交回复
热议问题