Re: rows to columns issue

2012-01-09 Thread John W. Krahn
Rajeev Prasad wrote: Hello, Hello, I tried following code but it is not working. I have a file with many lines(records) where field separator is space. I want to convert rows to columns, something like... source: a b c d 1 2 3 4 output: a 1 b 2 c 3 d 4 $ echo "a b c d 1 2 3 4" | perl

Re: rows to columns issue

2012-01-09 Thread Rajeev Prasad
  print $aoa[$y][$x]." ";     }     print "\n"; } - Original Message - From: Jim Gibson To: perl list Cc: Sent: Monday, January 9, 2012 3:29 PM Subject: Re: rows to columns issue On 1/9/12 Mon  Jan 9, 2012  1:08 PM, "Rajeev Prasad" scribbled: > &g

Re: rows to columns issue

2012-01-09 Thread Jim Gibson
On 1/9/12 Mon Jan 9, 2012 1:08 PM, "Rajeev Prasad" scribbled: > > > Hello, > > I tried following code but it is not working. > > I have a file with many lines(records) where field separator is space. > > I want to convert rows to columns, something like... > > source: > a b c d > 1 2 3 4

rows to columns issue

2012-01-09 Thread Rajeev Prasad
Hello, I tried following code but it is not working. I have a file with many lines(records) where field separator is space. I want to convert rows to columns, something like... source: a b c d 1 2 3 4 output: a 1 b 2 c 3 d 4 Here is my test code: It is not working :( #!/usr/bin/perl u