datopian / datapipes

Data Pipes for CSV
https://datapipes.okfnlabs.org/
MIT License
117 stars 16 forks source link

Cannot delete first row using /delete 0/ or /delete 0:n #122

Closed kes1 closed 7 years ago

kes1 commented 7 years ago

What a great tool!

With this CSV I'm not able to delete the first row, any range on the delete method - 0 or 0:4 and the first row always comes through.

Office,Perth
Station Name,Balmossie
Location Code,14919
Parameter,River Stage(SG)
Timeseries,SG.15m.Cmd
Data to be used in accordance with the SEPA General Data Reuse Statement, http://www.sepa.org.uk/media/219134/sepa-general-data-reuse-statement-v31.pdf
Date/Time,SG(m)
24/09/2017 16:30:00,0.417

Sample URL: http://datapipes.okfnlabs.org/csv/delete%C2%A00:4/?url=http://apps.sepa.org.uk/database/riverlevels/14919-SG.csv

Produces:


Date/Time,SG(m)
24/09/2017 16:30:00,0.417
24/09/2017 16:45:00,0.417
24/09/2017 17:00:00,0.417```
rufuspollock commented 7 years ago

Great that you like it!

This is a tricky one: the issue is that we always assume there is a header row by default for CSVs so the delete just applies to the non-header rows. What you want i think is to use the -H option to csv parser:

http://datapipes.okfnlabs.org/csv%C2%A0-H/delete%C2%A00:4/?url=http://apps.sepa.org.uk/database/riverlevels/14919-SG.csv

See http://datapipes.okfnlabs.org/csv/

If you like this kind of tool you may also like our new DataHub http://datahub.io/ 😄