CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Re: [Kdawg01] Copying a file and modifying line order output: Edit Log



Laurent_R
Veteran / Moderator

Mar 23, 2013, 5:29 AM


Views: 674
Re: [Kdawg01] Copying a file and modifying line order output

For detecting the "nx00" line, you can do the following:


Code
print "it is a nx00 line\n" if $line =~ /^n\d+00$/;


Similarly, to detect the "m6" line:


Code
if $(line =~ /^m6/) { # ...



Then, all you have to do is to start storing your lines in an array (or in something else, but an array is the simlplest) when you meet the nx00 line and until you meet the m6 line, and then to dump the array into your file once you've met the M6 line. Nothing complicated.

If you are running into difficulties, please submit the code you've written and explain what does not work as intended.


(This post was edited by Laurent_R on Mar 23, 2013, 5:30 AM)


Edit Log:
Post edited by Laurent_R (Veteran) on Mar 23, 2013, 5:30 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives