10000个数据集。。。10000.dat.元。每个文件都包含一行以@开头的行,并包含一个与此文件相关的空格的字符串,即lijec37 7.379 6.23。在
我有另外一组10000个文件_发送日期(其中XXX从1到10000)。每个文件只有一行。每条线路均为thsis类型:
_1 3456.000000-21 0-98.112830-20.326192
我想做的是,对于每个数字XXX(介于1到10000之间),从cXXX.dat公司将字符串像c37 7.379 6.23一样归档,并将其添加到确定的\u cXXX文件中_发送日期到文件的开头,我得到:
c37 7.379 6.23?1 3456.000000-21 0-98.112830-20.326192
我尝试了bash和python,但没有找到好的解决方案。在
最好的方法是什么?在
谢谢
如果两种类型的文件都只有一行:
编辑:
^{pr2}$在Python中,可以执行类似的操作
它还没有经过测试,但应该可以用
编辑:我意识到你想在已确定的∗cXXX的开头添加一行_发送日期,不是在结尾。
因此,根据丹尼斯·威廉姆森的回答,我还可以提出以下bash代码
^{pr2}$一种基本上用来处理文本的语言:Perl!
相关问题 更多 >
编程相关推荐