Hello oh knowledge masters. You guys have helped me along the way to learning about PERL, so I find myself stuck again. I have a large file that I read into an array, and I need to strip out information that is not needed. Now the first 16 characters of the data I want to keep(for every record), and then after that I want to keep 30 characters before and 30 charaters after another set string.
I wrote the regex like this:The first part is for clean up, the second part is where I am having the problems. After my matches are found then everything else should just be deleted. Am I atleast in the right nieghborhood?foreach $i(@n){ $i =~s/\s//gm; } foreach $i(@n){ unless ($i =~ /^\d{16}/) else ($i =~ /.{30}Some search string.{30} +/) $i =~ s/.//gm;} }
Please help.
janitored by ybiC: Minor format cleanup, including balanced <code> tags around snippet
In reply to regex man they are tough by tgolf4fun
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |