add line order to each line and remove the last match of each line
来源:互联网 发布:apache tiles3 教程 编辑:程序博客网 时间:2024/05/17 01:37
import ref_in = open("C:/work_files/libigl/tutorial/shared/male1.tgf") f_out = open("C:/work_files/libigl/tutorial/shared/male1.o.tgf", "w") for row in range(1,17914): line = f_in.readline() pos = re.search(" 0(?!.* 0)",line).start() line = line[:pos] f_out.write("%d %s\n" % (row, line)) print("adding done!") f_out.close() f_in.close()
0 0
- add line order to each line and remove the last match of each line
- Increase the ordinal number at the beginning of each line
- append a string to each line
- 每天一个命令(20) cut (remove sections from each line of files)
- Why do my text files suddenly have an additional at the end of each line?
- [每日练习] write a function to find the key in a m*n matrix, where each line and column is incremental
- exchange two numbers in each line
- vim delete spaces for each line
- Linux - How to remove the new line at the end of file when using vim
- LINE
- line
- line
- line
- Read the Last line in a file
- Add new line and delete line using javascript
- Characterization of The Line Profile
- The End-of-Line Story
- the measurement of trancesform line
- Dubbo入门介绍
- Visual Studio 2015编译64位MySQL Connector/C++
- IOS、Android进阶之ReactNative热更新
- caffe遇到 ImportError: libcudart.so.7.5: cannot open shared object file: No such file or directory
- mysql主从数据库状态检测(php)
- add line order to each line and remove the last match of each line
- 【译】“错误”的使用 Swift 中的 Extension
- spark-submit工具参数说明
- Linux命令学习手册-wc命令
- MySQL索引原理及慢查询优化--美团分享
- 个人界面 < 头像 > 图像添加,其他颜色的边框(内外都可以)
- 绿色版mysql安装过程
- NDK笔记
- KNN算法在保险业精准营销中的应用