我有一个包含以下条目的文件:
folder1/a_b.csv folder1/generated/
folder2/folder3/a_b1.csv folder12/generated/
folder4/b_c.csv folder123/generated/
folder5/d.csv folder1/new_folder/generated/
folder6/12.csv folder/anotherfolder/morefolder/evenmorefolder/generated/
我想从每一行复制 csv 文件名,将它们粘贴到该行的末尾并附加“.org”。因此,更改后的文件看起来像
folder1/a_b.csv folder1/generated/a_b.csv.org
folder2/folder3/a_b1.csv folder12/generated/a_b1.csv.org
folder4/b_c.csv folder123/generated/b_c.csv.org
folder5/d.csv folder1/new_folder/generated/d.csv.org
folder6/12.csv folder/anotherfolder/morefolder/evenmorefolder/generated/12.csv.org
基本上,我在 vim 或 sed 中寻找一个命令,使用它我可以在每一行中搜索一个模式并将其附加到该行的末尾。可能吗?
提前致谢。