Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
スプレッドシート(.tsv)に日付のリストを含む列があります(一部のセルは空白です): 6/30/1988 1/2/2000 など...
そして、列に日付のリストを含むfile.tsvが必要です(データベースへのエクスポート用であり、ジョイントに空白のセルが必要なため、空白のセルを保持します): 1988-06-30 2000-01- 02 など ...
いろいろ調べましたが、初心者なのでわかりません。どうもありがとう
date次のコマンドを使用できます。
date
$ date -d 6/30/1988 +%F 1988-06-30
以下は、外部プログラムを使用しない bash/korn シェル ソリューションです。
while IFS='/' read dd mm yyyy do printf "%04d-%02d-%02d\n" $yyyy $mm $dd done < filename
IFS を設定すると、その文字の前後の値が分離されます。