[Qgis-user] TXT TO SHP

Stefan Kiefer st_kiefer at web.de
Fri Aug 27 22:12:45 PDT 2010


Hi john,
please always post answers as well to the list.

Your file has two issues:
the first line should be the header, same composition as the datalines
(means same delimiter, e.g. same number of spaces or any other delimiter
comma, semikolon ...).
After the header only datalines are alowed.
your file looks like:

Magnetic Dataset - Total Records: 347878
Latitude[4spaces]Longitude[4spaces]Intensity(nT)
-------------------------------------------
35.0000380[2spaces]-115.2569270[2spaces]-183.64
.
.
.

You need to delete the first line ("Magnetic ...") and the third line
("-----...").
And you have to replace the 4sapces by 2spaces, the 2spaces by 4spaces
or maybe by one single tab. If it looks like:

Latitude[tabulator]Longitude[tabulator]Intensity(nT)
35.0000380[tabulator]-115.2569270[tabulator]-183.64

you should have no troubles to import the file with the delimited text
plugin. Set separator to: \t
Maybe you prefer only change the 4spaces to 2spaces then of course you
need to insert 2 spaces as delimiter for the header line.

cheers

Stefan

Am Freitag, den 27.08.2010, 10:51 -0700 schrieb john:
> Hello Stefan, 
>     I think the format is .txt. I sent a copy of the file as an
> attachment. With the plugin I can load the file and have tried the
> different settings but every time II click o.k. I get the error
> message "layer is not valid.... layer G:/mag as text file txt?
> delimeter=\tdelimeter Type= plain&xfield..........is not a valid
> layer. Any suggestions will be greatly appreciated, J.R.
> 
> 
> From: Stefan Kiefer 
> Sent: Thursday, August 26, 2010 11:54 PM
> To: john 
> Cc: Qgis-user at lists.osgeo.org 
> Subject: Re: [Qgis-user] TXT TO SHP
> 
> 
> What format has the txt file? The file should have a header to get all
> da to import a delimited text it should be composed from at least a x
> and y coordinate. You have to give the delimiter (probably a "," or
> maybe a tabulator = \t . If you now select a file, then you can chose
> the x resp. y column in the listboxes. If that not works be sure that
> the coordinates are written in british system, I mean decimal values
> delimited by a ".". For me this works perfectly.
> If  you have further trouble please post the composition of the text
> file.
> 
> cheers
> 
> Stefan
> 
> Am Donnerstag, den 26.08.2010, 20:49 -0700 schrieb john: 
> > HELLO ALL,
> >    ANY ONE KNOW AN EASY WAY TO DISPLAY A TXT FILE WITH LONGLAT
> > CO-ORDS AS A SHP FILE IN QGIS AND THEN CONTOUR ATTRIBUTES WITH
> > VALUES IN SIMILAR RANGES? I'VE TRIED THE PLUGIN, ADD DELIMETED TEXT,
> > BUT WENT AROUND IN CIRCLES AND EVENTUALLY CRASHED MY 1.5.0 VERSION.
> > ANY SUGGESTIONS WILL BE GREATLY APPRECIATED. 
> >    J.R. 
> > _______________________________________________
> > Qgis-user mailing list
> > Qgis-user at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/qgis-user
> 





More information about the Qgis-user mailing list