in reply to Re: Re: Reading Text from file and reorganization
in thread Reading Text from file and reorganization

What I'd do is the following..
#!/usr/bin/perl -w use strict; my @newfile; open (FH, "./testfile"); while (<FH>) { chomp; push @newfile, $_.' '.<FH>; } close FH;
Here's what's going on. In the while loop I'm getting the 1st line of the file. Then I'm taking the newline character off of it. Then.. I'm taking that line, concatinating it with a space and the next line from the file. NOTE: I'm not stripping the newline character off of that one because you're going to want a new line there :). Then I'm pushing that new string on to an array.

Now all you have to do is write it out..

Hope this helps..
Rich