regex - 将第一行追加到以下行直到下一个空白行?
问题描述
我有这种形式的数据:
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 :) 这对我来说是魔法巫术。
解决方案
推荐阅读
- swift - 向 CollectionView 两列结构添加全宽行
- flutter - flutter_inappwebview 如何将网站列表放入内容拦截器?
- ios - iPadOS 15 UITabBar 标题被截断
- javascript - 如何在多个子域上运行一段代码?
- c# - 如何从 c++ 项目调用 windows 窗体 c# 函数?
- python - 如何在 Ajax 符合数据结构中获取 Django 查询集?
- c# - Azure .NET 5 隔离函数以及如何使用函数绑定更新表存储
- c++ - 为什么 MSVC 编译器/优化器不会删除共享库中重复的函数调用,而是复制整个函数体?
- python - 根据数据框中某列中的值添加一列
- mongodb - AWS DocumentDB 和 Atlas Mongo 上托管的相同数据库的不同数据库大小