Archives
Categories
Tag Archives: tsv
Picking Subsets of CSV/TSV Files With awk
Say you have a csv or tsv file, and you want to only select the bits where a particular column is not zero. Start with a csv like this: earl$ head ttt 104834, 0, 206, 104578, false 104837, 4, 206, … Continue reading
Howto Remove Tabs From CSV Files, A Second Method
As mentioned before, you regularly want to transform tsv files into csv files. While tr is a much less powerful program than sed or awk, it is much easier to use: tr ‘\t’ ‘,’ < input_file > output_file
Writing MySQL Query Results to Disk
Notes to myself: how to easily write query results to disk using mysql. mysql -h main-backup.local -u earl -e “select count(*) from adsense_analytics_days;” -p collegelist_development > csvname.csv; where h specifies the name of the mysql server, u the username, e … Continue reading
Saving MySQL Query Results into csv
Say you have a mysql query such as select start_date, count(*), sum(impressions) as impr, sum( revenue) as revenue from adsense_analytics_days group by start_date order by start_date desc and you want to save the results into a csv file. MySQL makes … Continue reading