Hi,

The result is ok, but one big problem. My input file is a csv file. Its
records are like:
2007/02/26 09:38:03,999,+60320840888,+60123773138,,1,5,2007/02/26
09:37:58,,,,2,1,0,7,1,3,1,,0,4,+60320840888,,BRT70607,NOKIA_160_ISDN,,KL,KL
2007/02/26 09:38:05,999,+60320848888,+60326931722,,1,21,2007/02/26
09:37:44,,,,2,18058788,0,7,1,3,1,,0,4,+60320848888,,TR370001,NOKIA_160_ISDN,,KL,KL
2007/02/26 09:37:48,999,+60320937574,+60192805588,,1,1,2007/02/26
09:37:47,,,,2,20272626,0,7,1,3,1,,0,4,+60320937574,,BRT70657,NOKIA_160_ISDN,,KL,KL
2007/02/26 09:37:52,999,+60320923505,+60360753333,,1,20,2007/02/26
09:37:32,,,,2,22904137,0,7,1,3,1,,0,4,+60320923505,,RCT70749,NOKIA_160_ISDN,,KL,KKB

 But the output I get is not comma seperated but space seperated:-
2007/02/26 10:04:36 999 +60320930016 +60122966096  1 4 2007/02/26
10:04:32    2 20275468 0 7 1 3 1  0 4 +60320930016  RCT70544 NOKIA_160_ISDN
KL KL
2007/02/26 09:48:28 999 +60320870666 +60371180497  1 250 2007/02/26
09:41:38    2 20275933 0 7 1 3 1  0 4 +60320870666  RCT70803 NOKIA_160_ISDN
KL KL
2007/02/26 10:06:49 999 +60320922115 +1800879415  1 113 2007/02/26
10:04:16    5 20275921 0 7 1 3 1  0 2 +60320922115  BRT70630 NOKIA_160_ISDN
KL

This is unacceptable. What changes do I have to make to the script to get a
comma seperated output?

Thanks,
Mihir
On 8/1/07, Rob Dixon <[EMAIL PROTECTED]> wrote:
>
> [EMAIL PROTECTED] wrote:
> >
> > Small correction....
> >
> > Try
> > open my F, '>outputsample1' or
> >      die 'Failed to open outputsample1';
> > my $f = \*F;
> > while (($key, $value) = each %hash)
> >  {
> >
> >          print $f  $value."\n";
> >
> > }
> >  close $f;
>
> Yaron.
>
> It would help if you tested your code before you published it. This is
> nonsense. This part of Mihir's code was fine as it was, while yours
> doesn't
> even compile.
>
> Rob
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> http://learn.perl.org/
>
>
>

Reply via email to