Re: Tabulate data in a sequential file

2004-12-04 Thread Lawrence Statton
> Lawrence, > > Thanks for your explanation and pointers to perldoc, I can now manage > it basically. > > To print them out, now I use > > for ($i=0; $i<=$max_records; $i++) { >foreach $key (@keys) { > print $data{$key}[$i]; >} > } > > A little bit clumsy,

Re: Tabulate data in a sequential file

2004-12-04 Thread Chan YW
Lawrence, Thanks for your explanation and pointers to perldoc, I can now manage it basically. To print them out, now I use for ($i=0; $i<=$max_records; $i++) { foreach $key (@keys) { print $data{$key}[$i]; } } A little bit clumsy, but it can do my work and I

Re: Tabulate data in a sequential file

2004-12-04 Thread Lawrence Statton
> Hi, > > I'm just learning Perl and hit a wall when I don't really understand > how associative array works, could you kindly give me a guidance? > > I want to tabulate a file as follow? > > -- source --- > key1: data1a > key2: data2a > key3: data3a > key1: data1b > key2: data2b > key3: data3b

Tabulate data in a sequential file

2004-12-04 Thread Chan YW
Hi, I'm just learning Perl and hit a wall when I don't really understand how associative array works, could you kindly give me a guidance? I want to tabulate a file as follow? -- source --- key1: data1a key2: data2a key3: data3a key1: data1b key2: data2b key3: data3b ... --- to --- key1ke