Skip to content

Commit

Permalink
allow to change CSV separator flother#14
Browse files Browse the repository at this point in the history
  • Loading branch information
LuisBL committed Jul 10, 2023
1 parent deda39f commit b5979d2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/htmltab/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@
"strings. Use multiple times if you have more than one "
"currency symbol [default: '{}']".format("', '".join(DEFAULT_CURRENCY_SYMBOLS)),
)
@click.option(
"--sep",
type=str,
default=",",
help="set CSV separator [default ',']",)
@click.option(
"--output",
"-o",
Expand All @@ -74,6 +79,7 @@
@click.version_option()
def main(
select,
sep,
null_value,
convert_numbers,
group_symbol,
Expand Down Expand Up @@ -216,7 +222,7 @@ def main(
rows.append(row)

# Output the CSV to stdout.
output = csv.writer(output)
output = csv.writer(output, delimiter=sep)
for row in rows:
# Extra empty cells are added to the row as required, to ensure that
# all rows have the same number of fields (as required by the closest
Expand Down

0 comments on commit b5979d2

Please sign in to comment.