how can i change the text delimiter

sonald sonaldgr8 at gmail.com
Thu Aug 31 03:25:38 EDT 2006


Hi,
I am using
Python version python-2.4.1 and along with this there are other
installables
like:
1. fastcsv-1.0.1.win32-py2.4.exe
2. psyco-1.4.win32-py2.4.exe
3. scite-1.63-setup.exe

We are freshers here, joined new... and are now into handling this
module which validates the data files, which are provided in some
predefined format from the third party.
The data files are provided in the comma separated format.

The fastcsv package is imported in the code...
     import fastcsv
and
     csv = fastcsv.parser(strict = 1,field_sep = ',')

can u plz tell me where to find the parser function definition, (used
above)
so that if possible i can provide a parameter for
text qualifier or text separator or text delimiter..
just as {field_sep = ','} (as given above)

I want to handle string containing double quotes (")
but the problem is that the default text qualifier is double quote

Now if I can change the default text qualifier... to say pipe (|)
the double quote inside the string may be ignored...
plz refer to the example given in my previous query...

Thanks..






Fredrik Lundh wrote:
> "sonald" wrote:
>
> > fast csv is the the csv module for Python...
>
> no, it's not.  the csv module for Python is called "csv".
>
> > and actually the string cannot be modified because
> > it is received from a third party and we are not supposed to modify the
> > data in any way..
>
> that doesn't prevent you from using Python to modify it before you pass it to
> the csv parser, though.
>
> > for details on the fast CSV module please visit
> >
> > www.object-craft.com.au/projects/csv/ or
>
> that module is called "csv", not "fastcsv".  and as it says on that page, a much
> improved version of that module was added to Python in version 2.3.
> 
> what Python version are you using?
> 
> </F>




More information about the Python-list mailing list