我有一個巨大的文本文件,最後一個逗號後更換最後一個字符,看起來是這樣的:用繩子
36,53,90478,0.58699759849,0.33616,4.83449759849,0.0695335954050315,3
36,53,90478,0.58699759849,0.33616,4.83449759849,0.0695335954050315,8
36,53,90478,0.58699759849,0.33616,4.83449759849,0.0695335954050315,14
36,53,15596,0.58454577855,0.26119,2.24878677855,0.116147072052964,12
所需的輸出是這樣的:在這裏
36,53,90478,0.58699759849,0.33616,4.83449759849,0.0695335954050315,MI-03
36,53,90478,0.58699759849,0.33616,4.83449759849,0.0695335954050315,MI-08
36,53,90478,0.58699759849,0.33616,4.83449759849,0.0695335954050315,MI-14
36,53,15596,0.58454577855,0.26119,2.24878677855,0.116147072052964,MI-12
我已經試過其他相關職位和其他社區,但不能完全得到我想要的。
UPDATE
這是cross-question(我想在Unix/perl的答案,此批/ PowerShell的解決方案。),有有趣的答案。
是否所有的線始終8 - 逗號分隔的元素? – dcg
是的! 8個元素。 – Masoud