Wondering if it's possible to automate some repetitive tasks in QGIS (2.0).

This is my general workflow for importing some xyz type text files from another software package which export (not overly efficient) fixed column data:

  1. import fixed column text file into Excel
  2. add fieldnames
  3. create unique id field and populate using a combination (concatenate) of two fields in the existing data
  4. remove null rows in between data groupings
  5. remove unwanted columns
  6. save to csv
  7. import into QGIS
  8. convert to polylines and save as shapefile

I'm thinking that this is achievable in QGIS alone via some scripting?

Example File:

Example of point file

So, I want to keep the first 4 columns (X,Y,ID,Value), delete the final column, remove the rows with text, and create a polyline shapefile based on a field which is a combination of the 3rd (ID) and 4th (Value) columns (e.g. 0_2000, 0_2100, 1_2100, etc) .

closed as off-topic by PolyGeo Nov 8 '17 at 0:27

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions seeking help to debug/write/improve code must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Providing a clear problem statement and evidence of a code attempt will help others to help you. See: How to create a Minimal, Complete, and Verifiable example." – PolyGeo
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    All it is possible in PostgreSQL/PostGIS (from import text file to receive shapefile). Please provide sample of text file – HasT Oct 14 '13 at 11:54
  • If you know Python and PyQGIS, you can do everything in the Python console or with a script in Processing, without Excel – gene Oct 14 '13 at 16:11
  • Thanks, silly question perhaps. How do I go about attached a file to a post? – Geezer Oct 14 '13 at 21:42
  • see gis.stackexchange.com/help/formatting – Willy Oct 15 '13 at 3:51
  • Images Images can be added primarily by using the the editor toolbar button insert image toolbar button. This brings up a special interface that allows you to upload an image online (through the imgur hosting service) through us - even from your clipboard. Alternatively, it can be input similarly to adding a link: HTML <img src="example.com/img.jpg"> Markdown !sample image – Willy Oct 15 '13 at 3:52

Browse other questions tagged or ask your own question.