
我的 csv 檔案有 100 行,只有一列。我需要在其末尾添加 100 行逗號。我該怎麼做?
答案1
要將 100 行(每行一個逗號)加入到文件末尾data
:
yes , | head -n 100 >>data
該yes
實用程式通常會y
無限地輸出該字母,但yes ,
我們將其更改y
為逗號。我們取出前 100 個逗號並將其附加到文件中。
答案2
printf '%.s,\n' {1..100} >>file
我的 csv 檔案有 100 行,只有一列。我需要在其末尾添加 100 行逗號。我該怎麼做?
要將 100 行(每行一個逗號)加入到文件末尾data
:
yes , | head -n 100 >>data
該yes
實用程式通常會y
無限地輸出該字母,但yes ,
我們將其更改y
為逗號。我們取出前 100 個逗號並將其附加到文件中。
printf '%.s,\n' {1..100} >>file