替换文本文件python中的列

时间:2014-02-18 15:55:07

标签: python

我有一个包含多个列的.txt文件,我想替换另一列的第一列。我正在尝试以下方法:

JD[] #Are the data for which I want to replace the first column of the file.

with open('filedata.txt', 'r') as f:
        print f.readline().rstrip('\n')

        for value, line in zip(JD, f)
                  elements = line.split()
                  A = format(value,elements[1:])

np.savetxt(A)

0 个答案:

没有答案