On Sat, Jun 21, 2003 at 11:36:36PM +0200, Paul Johnson wrote: > On Sat, Jun 21, 2003 at 12:40:19PM -0700, Ioana Cozmuta wrote: > > [ Kept on p5p so no one else need reply, followups to perl-beginners ] > > > I did not intend to offend anybody with my message nor did I realize that > > this is a very restricted list. My appologies. > > That's alright. I'm sure we'll allow one mistake :-) > > > 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... > > In that case, the construct you are looking for is split /\t/ > > perl -le '$_ = "1\t2\t\t4\t5"; @x = split /\t/; print "$_: ", $x[$_] || 0 for 0..9' > > perldoc -f split > > See you on another forum. I think perl-beginners is especially suitable > for this type of question. So, it would seem, did mjd.
And we both made the same mistake. It is [EMAIL PROTECTED] http://lists.cpan.org/showlist.cgi?name=beginners -- Paul Johnson - [EMAIL PROTECTED] http://www.pjcj.net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]