Don't ask to ask, just ask | |
PerlMonks |
Keep only X number of entries of a file using a delimeterby Anonymous Monk |
on Oct 13, 2015 at 13:30 UTC ( [id://1144698]=perlquestion: print w/replies, xml ) | Need Help?? |
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks! I have a big file that contains several thousands of entries, which are separated by the delimiter "#". What must I write to keep the first, say, 500 entries? I know how to split this file into 1 file per entry with awk for example, but I can't find a way to just keep a number of entries and discard the rest.
Back to
Seekers of Perl Wisdom
|
|