Hello all,
 
I have a line of text and numbers each seperated by multiple or single
spaces  looks like this
 
abc   123  33545      789
 
I wanted to split the above line and store each column value in a specific
variable and later print,
 
Below is the code I am using but it's not working as I desire,
 
 $Avg=$first[$i];
         chomp($Avg);
         ($label,$TD,$YT,$M,$L,$Y,$W)= split (/i\s*/,$Avg);
          print "$label,$TD,$YT,$M,$L,$Y,$W\n";
 
I used "\s*" in split, so I do not have worry about counting the spaces or
tabs between each field
 
Any suggestions on what am I doing wrong..?
 
Regards
 
 
 
 

Reply via email to