在Python中拆分原始数据
我想从Python删除TXT文件的原始数据。这样的原始数据:
-0.156 200
-0.157 300
-0.158 400
-0.156 201
-0.157 305
-0.158 403
-0.156 199
-0.157 308
-0.158 401
我希望将文件提取到这样的许多TXT文件。
-0.156 200
-0.157 300
-0.158 400
-0.156 201
-0.157 305
-0.158 403
-0.156 199
-0.157 308
-0.158 401
你能帮我吗?
I want to cut the raw data from txt file by python. The raw data like this:
-0.156 200
-0.157 300
-0.158 400
-0.156 201
-0.157 305
-0.158 403
-0.156 199
-0.157 308
-0.158 401
I expect to extract the file to many txt file like this.
-0.156 200
-0.157 300
-0.158 400
-0.156 201
-0.157 305
-0.158 403
-0.156 199
-0.157 308
-0.158 401
Would you please help me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这将数据分配给每个文件中的三个条目
new_file_1.txt
new_file_2.txt
new_file_3.txt中的三个条目
This splits the data into files with three entries in each file
new_file_1.txt
new_file_2.txt
new_file_3.txt
如果线之间有空格,并且希望在新文件中的行之间的线路之间有空间,这将有效:
If you have spaces between your lines and you want spaces between your lines in your new file this will work: