\x20*[\n\r]+
我有一个损坏的文本文件,\xa0
如果下一行(如果存在)不以特定模式开头,我需要替换它DATA\t
。如果此类行以空格开头\x20+
,则也应将其删除。
我可以这样做sed
吗?文本文件大小约为 1MB。
数据示例:
DATA 132942, "I love you", 2398, "Hi how are you"
DATA 78793, "It is
me", 4322, "My name is Frank"
DATA 24121, "Where
are
you", 52432, "I am
here"
DATA 43242, "End of story", 432432, "The end"
=>
DATA 132942, "I love you", 2398, "Hi how are you"
DATA 78793, "It is me", 4322, "My name is Frank"
DATA 24121, "Where are you", 52432, "I am here"
DATA 43242, "End of story", 432432, "The end"