Skip to content

Instantly share code, notes, and snippets.

@fish8
Last active September 14, 2020 07:15
Show Gist options
  • Save fish8/d637d26f3502d3c7e6d2e1b96364754d to your computer and use it in GitHub Desktop.
Save fish8/d637d26f3502d3c7e6d2e1b96364754d to your computer and use it in GitHub Desktop.
command line excel, csv
#to csv
#via csvkit
in2csv --sheet 区县级 基站工参统计.xlsx #to stdout
# via Gnumeric
ssconvert -T Gnumeric_stf:stf_csv 基站工参统计.xlsx
#select columns
in2csv --sheet 区县级 基站工参统计.xlsx |csvcut -c "城市名称","人数"
#find rows with matching regex
csvgrep -c phone_number -r "555-555-\d{4}" data.csv > new.csv
#csv with sql
csvsql --query "select name from data where age > 30" data.csv > new.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment