On Sat, Jun 21, 2003 at 12:40 PM -0700, Ioana Cozmuta wrote: >I do understand the problem, however I do not know how to put it in a perl >script. For example, in C this could be solved using pointers. >As I mentioned in my first e-mail, the data are tab delimited. If between >the tabs there is no value, then I know that one value is missing and I >also know at which position the value is missing because the pointer could >tell me the exact position in the line. >I understand that there are 10 columns with data at most delimited by >tabs. When for example data is missing at position 3 then the line would >read >data\tdata\t\tdata... >or at position 4 >data\tdata\tdata\t\tdata\tdata... >When I say the data is missing I mean there is no value at all present, >not even a zero (that would make things easier). >I also know that when a value is present it is at least a character (0). >Thus I could identify with a pointer the locations where I have \t\t >versus \tdata\t.
I think the following code is closely what you need: while (<INFILE>) { chomp; s/\t\t/\t0\t/g; # insert 0 push @arr, [ split (/\t/, $_) ]; } Regards Pavle