5

My script does simple job, run SQL from a file and save to CSV.

Code is up and running but there is odd behaviour while producing CSV output. Data starts at around line 70, rather then from very beginning in the CSV file.

#!/bin/bash
beeline -u jdbc:hive2:default -n  -p  --silent=true --outputformat=csv2 -f code.sql > file_date+`%Y%m%d%H%M%`.csv

I would like my data to start at the very first row of actual data.

1 blank;blank;blank
2 blank;blank;blank
3 blank;blank;blank
4 attr;attr;attr
5 data;data;data
6 data;data;data
7 data;data;data
8 data;data;data
9 data;data;data
Gomz
  • 850
  • 7
  • 17
marcin2x4
  • 1,321
  • 2
  • 18
  • 44

1 Answers1

4

Workaround embedded in next step of my automation:

 sed -i '/^$/d' file.txt 
marcin2x4
  • 1,321
  • 2
  • 18
  • 44