in reply to Re^2: To split with spaces
in thread To split with spaces
Hi there, if that's the case then to parse all the fields something like:
Would print:printf "|%4s|%4s|%2s|%2s|%2s|%3s|\n", map {s/\s+//g;$_} unpack "A11A5A3A3A3A*" for <DATA>; __DATA__ 1234 2321 0 45 1st 2122 sdsa 0 0 34 2313 dsad 43 2nd 1232 ffff 0 0 1st 3213 sadf 0 34 2133 dada 0 2nd
|1234|2321| 0| |45|1st| |2122|sdsa| 0| 0|34| | |2313|dsad| | |43|2nd| |1232|ffff| 0| 0| |1st| |3213|sadf| | 0|34| | |2133|dada| 0| | |2nd|
|
|---|