Question : Column to Line

I have a text file that I am reading into the program. The data in the text file is formatted like:

blah 34     blah      01/01/01

I am interested in the "34" of that line. I wish to take all of the '34's' of the file and print them out in one long line, with a space in between each. So, if the file was 20 lines long, then the resulting printed line would have 20 items in it.

I know that I can separate on blank space. for instance I have used something similar to the following in the past:

while(<DATA>){
      my @f=split /\s+/;
}


I know if I read the data into an array, I should be able to print the second element of each line by saying something similar to print $f[1]. But I don't want to create another column with just the data I want, I wish to print out a line or row of the data I want. I am going to eventually put something in front of the printed line, to form a longer line, but the column to a line mechanic seems to be escaping me at the moment.

Any thoughts?

Answer : Column to Line

yes, the main point was that the number (in the example above '34') is stored in $1.
if you want a full line try something like
$ret = "";
while(<DATA>)
{
        $_=~/^[^\d]+(\d+)[\w\W]+/;
        $ret .=  $1." ";
}
/* now $ret will contain all the 34's in a line seperated by spaces.. */
Random Solutions  
 
programming4us programming4us