文字檔案處理 刪除每行前兩個字元
sed -i 's/^..//' file.txt
刪除檔案中的^M字元
sed -i "s/\r//”FILENAME
刪除該列的前10個字元
cut -b 10- filename
前面的行號清除掉
sed -e 's/^[0-9]*\.//g' raw2.txt
各行之前或後加字串
#前頭加個 ☆ 字串
awk '{print "☆"$0}' filename
sed -e 's/\(.*\)/☆\1/g' filename
#每行後加 ☆ 字串
awk '{print $0"☆"$' filename
sed -e 's/\(.*\)/\1☆/g' filename
No comments:
Post a Comment