我每天14個字符後重復的行鍵值如何在一個固定長度的文件重複的關鍵值每列
我的文件是這樣的:
KEYVALUE1 201604141111I201604141111C201604141111D201604141111E201604141111F
KEYVALUE1 201604141111G
KEYVALUE2 201604141111I201604141111C201604141111D201604141111E201604141111F
KEYVALUE2 201604141111G201604141111F
KEYVALUE3 201604141111I
KEYVALUE4 201604141111G201604141111I
我的輸出應該看起來像這樣,
KEYVALUE1 201604141111I
KEYVALUE1 201604141111C
KEYVALUE1 201604141111D
KEYVALUE1 201604141111F
KEYVALUE1 201604141111G
KEYVALUE2 201604141111I
KEYVALUE2 201604141111C
KEYVALUE2 201604141111D
KEYVALUE2 201604141111F
KEYVALUE2 201604141111G
KEYVALUE2 201604141111F
KEYVALUE3 201604141111I
KEYVALUE4 201604141111G
KEYVALUE4 201604141111I
請幫忙。
謝謝ED ..這工程就像一個寶石: )我只是對這些職位進行了小小的修改。它的14個字符而不是13個。發佈更改後,我的命令如下所示:awk'{while($ 2!=「」){print $ 1,substr($ 2,1,14); $ 2 = substr($ 2,15)}}'$ FILE_NAME> BREAK_FILE – Mahesh