【发布时间】:2023-03-11 10:16:01
【问题描述】:
当我在 Linux 终端 CLI 上执行如下描述时。
hive -e "desc hive_db.hive_table"
我得到以下输出
date string
entity string
key int
id string
direction string
indicator string
account_number string
document_date string
现在我想在执行此操作之前将输出重定向到一个文件我想删除每个字段之间的空格并且它们之间只有一个空格。
预期的输出低于
date string
entity string
key int
id string
direction string
indicator string
account_number string
document_date string
我已经尝试如下
hive -e "desc hive_db.hive_table" | tr -s " " > abc.txt
我得到的输出是
date string
entity string
key int
id string
direction string
indicator string
account_number string
document_date string
我得到的输出很接近,但我在每一行的每个字段之间都有one space and one tab
我怎样才能实现我想要的?
【问题讨论】: