我有一个包含多行的文本文件。
test =
more text more text more text more text
more text more text more text more text
... etc....
more text more text more text more text
more text more text more text more text
1 text
test2 =
more text more text more text more text
more text more text more text more text
3 more text
ETC
我想要做的是从一个数字开始向上移动行,并在找到的第一行(向后)以 '=\s' 结尾之后附加它们
预期输出:
test = 1 text
more text more text more text more text
more text more text more text more text
... etc....
more text more text more text more text
more text more text more text more text
test2 = 3 more text
more text more text more text more text
more text more text more text more text
我不知道该怎么做。
有人能帮我吗?