-3
目前我想更換13日逗號之間的所有逗號左和12逗號從右側的Unix
1856292496,-1863203096,302,918468087151,808648712,405670043170066,919015026101,M,6,T,0,15,2c,Dear Customer, Your Request is under Process,03,11/05/2017 10:00:00,11/05/2017 10:00:00,11/,11/05/2017 10:00:00,0,03,,255,,333,ERecharge_RCOM,919015540301
開始啓動要求
1856292496,-1863203096,302,918468087151,808648712,405670043170066,919015026101,M,6,T,0,15,2c,Dear Customer Your Request is under Process,03,11/05/2017 10:00:00,11/05/2017 10:00:00,11/,11/05/2017 10:00:00,0,03,,255,,333,ERecharge_RCOM,919015540301
當前
1856292499,-1863203087,301,918081224379,808648711,405540046666191,919026240102,M,6,T,0,15,8d,Dear Business Partner,your current Core balance is Rs.29.8,GSM balance is Rs.12892.14,MRCOM balance is Rs.1 and MRTL balance is Rs.1.Reliance,03,11/05/2017 10:00:00,11/05/2017 10:00:00,11/,11/05/2017 10:00:00,0,01,,255,,333,BalQuery_RCOM,919835853611
要求
1856292499,-1863203087,301,918081224379,808648711,405540046666191,919026240102,M,6,T,0,15,8d,Dear Business Partner your current Core balance is Rs.29.8 GSM balance is Rs.12892.14 MRCOM balance is Rs.1 and MRTL balance is Rs.1.Reliance,03,11/05/2017 10:00:00,11/05/2017 10:00:00,11/,11/05/2017 10:00:00,0,01,,255,,333,BalQuery_RCOM,919835853611
我需要在Unix系統上用空格替換從右邊開始的第13個逗號和從右邊開始的第12個逗號之間的所有逗號。
歡迎來到Stack Overflow。請儘快閱讀[關於]和[問]頁面。它有助於顯示[你有什麼嘗試](http://mattgemmell.com/2008/12/08/what-have-you-tried/)。這也有助於瞭解你會考慮哪些工具。在這種情況下,是Awk還是Perl或Python的選項?您已經正確顯示了輸入和所需的輸出數據,並有兩個精心挑選的示例。唯一可能的抱怨是,也許'左起第五個逗號和右側第七個逗號(或其他小於13和12的數字)可以更容易處理。但是你應該展示你的嘗試。 –
其實我對unix有點新,想用awk嘗試一下,但想不到方法, – AMyth
我所能想出來的就是這個[root @ PMS]#awk -F「,」'print $ 1 「 」$ 2「, 」$ 3「, 」$ 4「, 」$ 10「, 」$ 6「, 」$ 7「, 」$ 8「, 」$ 9「, 」$ 10「, 」$ 11「 $ 12 」$ 13「,」 $ 14}」 CDR_2017051100.txt |更 1856252627,-1863282815,917827516705,302,825819144,405050035380268,919015000105,M 1,T,0 $ 1218 * 302 * 7428196597 * 69 * 7515# 1856252627,-1863282814,302,917827516705,808648712,405150035380268,919015000105 ,M,6,T,0 $ 122c,尊敬的客戶 – AMyth