When I do a desc hive table like below on a Linux terminal CLI.
hive -e "desc hive_db.hive_table"
I get the following output
date string
entity string
key int
id string
direction string
indicator string
account_number string
document_date string
Now I want to redirect the output to a file before doing it I want to remove the spaces between each fields and have just one space between them.
The expected output is below
date string
entity string
key int
id string
direction string
indicator string
account_number string
document_date string
I have tried like below
hive -e "desc hive_db.hive_table" | tr -s " " > abc.txt
The output I get is
date string
entity string
key int
id string
direction string
indicator string
account_number string
document_date string
Th output I get is a close one but I have one space and one tab
between each fields in each line
How can I achieve what I want?