我有以下数据
11111 | aff | baucj | blah | blah
13331 | azvaff | bcacj | blah | blah
11111 | aasfff | aascj | blah | blah
13331 | aafzvff | baucj | blah | blah
12221 | arthrf | bacsfucj | blah | blah
12221 | ddhrhsd | hdafasfacj | blah | blah
我希望将这些合并为
11111 | aff | baucj | blah | blah | 11111 | aasfff | aascj | blah | blah
13331 | azvaff | bcacj | blah | blah | 13331 | aafzvff | baucj | blah | blah
12221 | arthrf | bacsfucj | blah | blah | 12221 | ddhrhsd | hdafasfacj | blah | blah
答案 0 :(得分:0)
怎么样:
find what: ^(\S+)(.+?)\n((?:(?!\1).*)?)(\1 .+?)\n
replace by: $1$2 | $4\n$3
检查“正则表达式”和“点匹配换行符”(我不确定这些标签,我没有英文版的NP ++)