Don't ask to ask, just ask | |
PerlMonks |
Re: Remove line from file based on numeric column valueby ww (Archbishop) |
on May 26, 2015 at 12:10 UTC ( [id://1127809]=note: print w/replies, xml ) | Need Help?? |
Canonical answer from aaron_baugher: Think in terms of writing your original content to a new file with some elements removed. BUT, re your narrative: Your phrase "the 8th column" should be "the 9th column" because your removal target is column 9. Just so it's clear, column 9 is the 8th element, $dataline[8], of an array (@arr) formed by splitting XP.sta1 -41.5166 0.0513 0.6842 0.1794 0 CPHI.BHZ 300.2458 -42.2436 on white space because "XP.sta1" is $line[0].
UPDATE: Your pseudocode (I hope it was intended as pseudocode) is far from actually useful and makes very little sense in terms of your problem statement. Something on this order might serve you better:
Your questions will benefit from careful use of language. Your "code so far" could be read as reflecting the PM admonition 'show us your code' ONLY if it accurately reflected your question ...and were it compilable.
In Section
Seekers of Perl Wisdom
|
|