LoginSignup
1
0

More than 5 years have passed since last update.

Athenaの結果をSedコマンドでBlazingText用に整形する

Posted at

備忘録的なものですが。
athenaで得られた結果は以下のcsvになってます。

"column"
"ああああ いいいい うううう"
"ああああ いいいい うううう"
"ああああ いいいい うううう"
"ああああ いいいい うううう"

BlazingTextで読み込むかたちにするには以下

  1. head行を取り除く
  2. 先頭、最後のダブルクォーテーションを取り除く
  3. 中身が半角スペースで分かち書きされている
    • こちらに関しては事前に

整形コマンド

ヘッダーをまず削る。

sed '1d' athena.csv > noheader.txt

先頭と最後のダブルクォーテーションを取り除く

sed -e 's/^"//g' -e 's/"$//g' noheader.txt > result.txt
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0