#!/usr/bin/python
# -*- coding: UTF-8 -*-
import sys
print(sys.argv[0])
print(sys.argv[1])
fr = open("C:\\Users\\Administrator\\Desktop\\file\\sql.txt")
fw = open("C:\\Users\\Administrator\\Desktop\\file\\sqlend.txt","w+")
a = 0
def start():
for line in fr.readlines():
a = a+1
if line.find("EXEC") != -1:
fw.write(line)
print(line,a)
def changeLine():
for line in fr.readlines():
while line.find(":") != -1:
startIndex = line.find(":")
index = startIndex
while line[index] != "|" and line[index] != " " and line[index] != ",":
index = index+1
line = line.replace(line[startIndex:index],"#{"+line[startIndex+1:index]+"}")
line = changeCml(line,startIndex,index+2)
print (line)
def
python文件处理(字符替换,驼峰更改)
最新推荐文章于 2022-11-17 13:36:31 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)