[Qgis-user] layer from delimited text file

Mats Elfström mats.elfstrom at gmail.com
Fri Jul 23 06:36:44 PDT 2010


Hi All!
Volker is right, the specification for the plug-in requires a header.
The header that is needed is in consistence with the RFC 4180
http://tools.ietf.org/html/rfc4180#section-2

3.  There maybe an optional header line appearing as the first line
       of the file with the same format as normal record lines.  This
       header will contain names corresponding to the fields in the file
       and should contain the same number of fields as the records in
       the rest of the file (the presence or absence of the header line
       should be indicated via the optional "header" parameter of this
       MIME type).  For example:

       field_name,field_name,field_name CRLF
       aaa,bbb,ccc CRLF
       zzz,yyy,xxx CRLF


I just checked this in QGis 1.4.0 Enceladus and the result was a bit
surprising.
It is true that the file parser makes good use of a header line like defined
above.
However, in the absence of a header line the plug-in simply assumes that the
item values of the first line are field names, which of course makes no
sense.
But as it is impossible for the plug-in to evaluate if the first line
actually is a header or not, it must be up to the user to understand this
and add an appropriate header line if it's missing.

But this does not solve the original problem. Even if the header was
missing, the plugin should have read the file.
Like others have suggested, the file may be locked by another application.
Other problems with csv files are usually line feeds in fields, trailing
spaces, the use of text delimiters (") and empty fields (,value,,,value,
should give two empty fields).

HTH Mats.E

2010/7/23 Volker Fröhlich <volker27 at gmx.at>

> You also need a header!
>
> Volker
>
> Am Freitag 23 Juli 2010, 12:10:08 schrieb Julio Cesar Canales DElgadillo:
> > Hello everybody,
> >
> > I'm trying to create a points layer from a *.csv file into Qgis 1.4,
> > however the application says that my file is not valid and that cannot be
> > loaded. I already checked the format of X and Y cells (as numbers) but it
> > doesn't work. Could anybody give me a tipp or sugestion about what I'm
> > doing wrong to solve this problem?
> > Thaknsa lot in advance, best regards.
> >  Biól.MCF. Julio César Canales Delgadillo.
> > Verhaltensbiologie
> > Barbarastr. 11
> > Fachbereich 5 Biologie/Chemie
> > Universität Osnabrück
> > 49076 Osnabrück
> > Phone: +(49) 0541 969 3803
> > Movil: +(49) 0152 043 87082
> > Alternative E-mail: julio.delgadillo at biologie.uni-osnabrueck.de
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-user
>



-- 
______________________________________________
Mats Elfström, Väpplingvägen 21, SE-227 38 LUND, Sweden
tel: +46 46 145959 / mob: +46 70 595 39 35
alt e-mail: mats.elfstrom at telia.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20100723/35e6dd68/attachment.html>


More information about the Qgis-user mailing list