In case of any number of commas

On 6/29/07, Raj Mathur <[EMAIL PROTECTED]> wrote:
>
> On Friday 29 June 2007 15:57, ankIT WALiA wrote:
> > Hi all,
> > I want to retrive data from csv file.let us say
> > recordLastname,Firstname,"Address, Apt/Suite
> > #123",City,State,Zipcodewhen i split it using comma,it seprate out
> > into LastnameFirstnameAddressApt/Suite #123CityStateZipcode
> > but i need to store data into
> > LastnameFirstnameAddress, Apt/Suite #123CityStateZipcode
> > I am usingvar oFile = Clib.fopen(vFilepath,"r");var string =
> > (Clib.fgets(oFile));                        if(string)
> >         {                           var arr = string.split(",");
> >                   } Please suggest something......
>
> Something like this?
>
> echo 'recordLastname,Firstname,"Address, Apt/Suite
> #123",City,State,Zipcodewhen'| \
> perl -MText::CSV -e \
> '$c=Text::CSV_XS->new();$s=$c->parse(<STDIN>);@c=$c->fields;map{print
> "$_\n"} @c;'
>
> recordLastname
> Firstname
> Address, Apt/Suite #123
> City
> State
> Zipcodewhen
>
> Regards,
>
> -- Raju
> --
> Raj Mathur [EMAIL PROTECTED] http://kandalaya.org/
>   GPG: 78D4 FC67 367F 40E2 0DD5 0FEF C968 D0EF CC68 D17F
>   It is the mind that moves
>
> _______________________________________________
> ilugd mailinglist -- [email protected]
> http://frodo.hserus.net/mailman/listinfo/ilugd
> Archives at: http://news.gmane.org/gmane.user-groups.linux.delhi
> http://www.mail-archive.com/[email protected]/
>



-- 
LIfe is like a Rose is upto u spreading its fragnance or thorns.
अन्कित वालिया
_______________________________________________
ilugd mailinglist -- [email protected]
http://frodo.hserus.net/mailman/listinfo/ilugd
Archives at: http://news.gmane.org/gmane.user-groups.linux.delhi 
http://www.mail-archive.com/[email protected]/

Reply via email to