首页 > 解决方案 > 将第一行追加到以下行直到下一个空白行?

问题描述

我有这种形式的数据:

Lastname, Firstname
[x] Title, (Dates, Abbreviations) Comment
[y] Something, (Dates, Abbreviations) Another Comment
Title, (Dates, Abbreviations)

Another Lastname, Firstname
[G] Big Deal, (Dates, Meaning) Comments
[y] Reptitions, (Dates, Abbreviations) Just Because
Awesome Title, (Dates, Something Else)

我想把它变成:

Lastname, Firstname, [x] Title, (Dates, Abbreviations) Comment
Lastname, Firstname, [y] Something, (Dates, Abbreviations) Another Comment
Lastname, Firstname, Title, (Dates, Abbreviations)

Another Lastname, Firstname, [G] Big Deal, (Dates, Meaning) Comments
Another Lastname, Firstname, [y] Reptitions, (Dates, Abbreviations) Just Because
Another Lastname, Firstname, Awesome Title, (Dates, Something Else)

删除第一行,将其附加到以下行,直到下一个空白行,然后重新开始。

仍在尝试破解 RegEx :) 这对我来说是魔法巫术。

标签: regexreplace

解决方案


推荐阅读