Categories
- Data Science (108)
- Hacking (27)
- Cryptology (1)
- Reverse Engineering (4)
- Security (23)
- Math & Statistics (27)
- Econometrics (4)
- Machine Learning (11)
- Math (3)
- Statistics (18)
- Substantive Expertise (56)
- Big Data (31)
- Computer History (3)
- Design (UI, UX, etc) (5)
- Economics (13)
- Game Theory (1)
- GIS (1)
- Text Mining (3)
- Hacking (27)
- Editorial (6)
- Programming (178)
- Quick Tips (32)
- Sys-Admin (26)
- Uncategorized (1)
Hive: Make CLI output files comma delimited
January 15th, 2015 | Author: jdm
bash >> hive -e ‘select * from some_Table’ | sed ‘s/[\t]/,/g’ > outputfile.txt
Here [\t] means Control+V and then the tab button, i.e.
sed ‘s/
Example:
[user@server]$ hive -e "use dbname ; select * from tablename" | sed ‘s/ /,/g’ > kpi_event_jan8.csv
Posted in Bash and Shell, Big Data, Programming, SQL and NoSQL, Substantive Expertise | Tags: bash, big-data, hive, hql, nosql
Tags
1-line anon bash big-data big-data-viz C data-science econ econometrics editorial hacking HBase hive hql infosec java javascript linux lists machine-learning macro micro mssql MySQL nosql padb passwords postgres programming python quick-tip r ruby SAS sec security sql statistics stats sys-admin tsql usability useable-sec web-design windows
Stackoverflow Solutions
Total Answered: 568
6
19th Jun 16