我有以下數據,嘗試了所有我可以,但沒能成功......GNU桑達符合豎條改變
Las Vegas Nevada 89102|US|Katrina Roetteler
zhen fo shan guang dong 528318|CN|tu min jung
Zurich CH8022|CH|Kevin M Pearl
Cheltenham GL52 8XX|UK|Kevin M Pearl
Melbourne Vic 3000|AU|brent chandler
Bratislava 821 03|Slovak Republic|SUSTRIK MARTIN MGR.
Zurich 8032|CH|David Graf
Tokyo 178-0063|JP|takahiro ichihashi
我需要改變這樣的:
Las Vegas Nevada|89102|US|Katrina Roetteler
zhen fo shan guang dong|528318|CN|tu min jung
Zurich |CH8022|CH|Kevin M Pearl
Cheltenham|GL52 8XX|UK|Kevin M Pearl
Melbourne Vic|3000|AU|brent chandler
Bratislava |821 03|Slovak Republic|SUSTRIK MARTIN MGR.
Zurich|8032|CH|David Graf
Tokyo|178-0063|JP|takahiro ichihashi
基本上在另一列(全球範圍內我的客戶的不同類型的郵編)中具有郵政編碼/郵政編碼,並且郵政編碼/郵政編碼位於第一個垂直條之前。
謝謝!
你可能將不得不使用單獨的正則表達式爲每個國家以符合該國的郵政代碼 – antlersoft 2013-04-24 20:45:05
你的標題和標籤建議您要使用SED這一點,而不是(比如說)AWK或Perl。這是爲什麼?你有一個已經部分工作的sed腳本? – ruakh 2013-04-24 20:45:32