Separated csv2tsv into its own module

This commit is contained in:
Robert Bendun 2023-03-18 17:42:18 +01:00
parent 6e25a62b37
commit 4b89e6d350
4 changed files with 9 additions and 2 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@ languages.*.tsv
columns.pruned.tsv columns.pruned.tsv
columns.original.tsv columns.original.tsv
*.csv *.csv
csv2tsv/csv2tsv

View File

@ -1,6 +1,6 @@
# Remove all columns according to specification in columns.pruned.tsv # Remove all columns according to specification in columns.pruned.tsv
languages.pruned.tsv: languages.original.tsv columns.user.tsv languages.pruned.tsv: languages.original.tsv columns.user.tsv
bash -c "cut -f`grep '^y' columns.user.tsv | cut -f2 | paste -sd ','` $< >$@" bash -c "cut -f`grep '^y' columns.user.tsv | cut -f3 | paste -sd ','` $< >$@"
# Allow user to mark in which columns is interested # Allow user to mark in which columns is interested
columns.user.tsv: columns.pruned.tsv columns.user.tsv: columns.pruned.tsv
@ -12,7 +12,7 @@ columns.pruned.tsv: columns.original.tsv
# Change data to TSV format since it is easier to process using standard UNIX tools # Change data to TSV format since it is easier to process using standard UNIX tools
%.tsv: %.csv %.tsv: %.csv
go run ./csv2tsv.go <$< >$@ csv2tsv/csv2tsv <$< >$@
# Check while downloading that file is as expected. # Check while downloading that file is as expected.
# Otherwise automatic filter mechanism wouldn't work. # Otherwise automatic filter mechanism wouldn't work.
@ -27,4 +27,7 @@ languages.original.csv: columns.original.csv
clean: clean:
rm -f languages.*.tsv languages.*.csv columns.original.tsv columns.*.csv columns.pruned.tsv rm -f languages.*.tsv languages.*.csv columns.original.tsv columns.*.csv columns.pruned.tsv
csv2tsv/csv2tsv: csv2tsv/csv2tsv.go
cd csv2tsv; go build
.PHONY: clean .PHONY: clean

3
csv2tsv/go.mod Normal file
View File

@ -0,0 +1,3 @@
module bendun.cc/ium/csv2tsv
go 1.20