Jamie, first of all I would read the file from top to bottom and then reverse my array to change the order of the entries. Then on every line that you read back I would do a comparison to check if I reached the piece of code you talked about that references the end of the input.
I'd use foreach $line (@masterlist){ to loop through the file and then check for your occurance of the end of the data marker by if ($line =~ "end marker data here!"){#break out of the loop} and use the split function to strip out the datafields ($user,$pass,$flag,$etc) = split(/,/,$line); See more about split using: perldoc -f split Jattie van der Linde -----Original Message----- From: Jamie Bridges [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 26, 2003 19:08 To: [EMAIL PROTECTED] Subject: parsing text files ... i have admittedly been lurking for awhile on this list b/c all of your advice has been helpful as reference in building some of my code. i haven't seen anything since i joined the list which could help me with the following problem so i hoped maybe you guys could address it for me. what i have is text files we created using a bourne shell script. we chunk together output from a solaris box into a standard format ( prtdiag | dmesg | format ) and then place this file on a server. we're writing a utility to unchunk this data and place it directly into individual cells in a mysql database. is there a way to tell the program to "read until you see this line and place everything you have read up to that line into @array" ...also could this start at the bottom of the file and read backwards up to a certain line? my big hang up that follows this problem is that these files are obviously dynamic and therefore can be of different lengths, and in some cases can also include drastically different information. in looking through many examples however, i have found lines which start and stop each portion that i can use as "end points" in my searching. i would post code but at this stage i don't have anything written past the initial : open( FILE, $file ); while ( <FILE> ) { push( @masterlist, $_ ); } close( FILE ); any advice that could be offered would be helpful. ----------------------------------------- Jamie Bridges Asst. Sun Hardware Lead -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]