how can i change the text delimiter

sonald sonaldgr8 at gmail.com
Wed Aug 30 06:01:47 EDT 2006


Hi Amit,
Thanks for a quick response...
E.g record is: "askin"em"

This entire text is extracted as one string but since the qualifier is
double quotes("), therefore fastcsv parser is unable to parse it.

If we can change the text qualifier to pipe(|), then the string will
look like this:
|askin"em|

But for this the default text qualifier in fastcsv parser needs to be
changed to pipe(|). how to do this?

Also please note that the string cannot be modified at all. Thanks.


Amit Khemka wrote:
> sonald <sonaldgr8 at gmail.com> wrote:
> > Hi,
> > Can anybody tell me how to change the text delimiter in FastCSV Parser
> > ?
> > By default the text delimiter is double quotes(")
> > I want to change it to anything else... say a pipe (|)..
> > can anyone please tell me how do i go about it?
>
> You can use the parser constructor to specify the field seperator:
> Python >>>  parser(ms_double_quote = 1, field_sep = ',', auto_clear = 1)
>
> cheers,
> amit.
>
> --
> ----
> Amit Khemka -- onyomo.com
> Home Page: www.cse.iitd.ernet.in/~csd00377
> Endless the world's turn, endless the sun's Spinning, Endless the quest;
> I turn again, back to my own beginning, And here, find rest.




More information about the Python-list mailing list