Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow -o unicsv,fields=... #1042

Closed
jidanni opened this issue Mar 25, 2023 · 2 comments · Fixed by #1059
Closed

Allow -o unicsv,fields=... #1042

jidanni opened this issue Mar 25, 2023 · 2 comments · Fixed by #1059

Comments

@jidanni
Copy link
Contributor

jidanni commented Mar 25, 2023

https://www.gpsbabel.org/htmldoc-development/fmt_unicsv.html says:

fields option
Name and order of input fields, separated by '+'.

This option lets you specify the field names of your input file from the command line instead of relying on the first line of your input file describing the file. Field names are separated by a '+' character. The list of field names is exactly that allowed in the first line of a unicsv file without this option.

Example 3.45. Example for unicsv fields option to describe input file.

For example ... gpsbabel -i unicsv,fields=lat+lon+description -f file.csv -o gpx -F file.gpx declares that file.csv has three fields, latitude, longitude, and description, in that order.

OK that's great. But it would also be great if one could do the same for output. E.g., for -i kml -o unicsv it seems the default is

  • No+Latitude+Longitude+Altitude+Date+Time .

Well, if we could do

  • -o unicsv,fields=Latitude+Longitude+Altitude+Date+Time

we could e.g., shave off the No field, without needing to resort to awk, perl, or -o xcsv,style=file.style .

@jidanni
Copy link
Contributor Author

jidanni commented Mar 26, 2023

Here the user should get an warning that "fields has not been
implemented for output, at least yet!"

gpsbabel -i kml -f - -o unicsv,fields=no+latitude -F -

@robertlipe
Copy link
Collaborator

I'm not sure we want to duplicate Style in unicsv. They're different..

I do agree that should be an error. Now it is.

./gpsbabel -t -i unicsv -f /dev/null -x nuketypes,waypoints -o unicsv,fields=no+latitude -F z.csv

unicsv : option 'fields' is not supported on output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants