如何读入文件并去除行,然后拆分值?

How to read in a file and strip the lines, then split the values?

我需要读入一个文件,然后剥离文件的行,然后拆分每一行的值,最后写出到一个新文件。本质上,当我拆分行时,所有值都是字符串,然后一旦它们被拆分,每行将成为它自己的列表!我写的代码仍然只是复制文本并将其粘贴到新文件而没有剥离或拆分值!

with open(data_file) as data:
    next(data)
    for line in data:
        line.rstrip
        line.split
        output.write(line)
logging.info("Successfully added lines")
with open(data_file) as data:
    next(data) #Are you sure you want this?  It essentially throws away the first line
               # of the data file
    for line in data:
        line = line.strip()
        line = line.split()
        output.write(line)
logging.info("Successfully added lines")