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

Add command line options for CSV input files which are passed along to Text::CSV #1

Merged
merged 1 commit into from Mar 19, 2021

Conversation

jbob
Copy link
Contributor

@jbob jbob commented Mar 16, 2021

Since not all CSV files are created equal, options to treat different CSV files differently are necessary 😉

The two new options allow to specify the separator character(s) in the CSV
file (--csv-sep ";", -s) and to relax the CSV parsing (--csv-loose, -l).

This calls the Text::CSV methods sep() as well as allow_loose_quotes() and allow_loose_escapes().
Example:

csv2json --csv-sep ";" --csv-loose input.csv > output.json

…ong to Text::CSV

The two options allow to specify the separator character(s) in the CSV
file (--csv-sep ";", -s) and to relax the CSV parsing (--csv-loose, -l).

Example:
```
csv2json --csv-sep ";" --csv-loose input.csv > output.json
```
@perlancar perlancar merged commit c111a01 into perlancar:master Mar 19, 2021
@perlancar
Copy link
Owner

Hi, thanks for this! Merged.

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 this pull request may close these issues.

None yet

2 participants