01 概 念
如果要处理的文件比较简单,直接使用字符串匹配就可以了,如下:
那么使用字符串匹配的python代码:
def find_start_re(fname):
f = open(fname,'r')
for line in f:
if line.startswith('re'):
print(line)
f.close()
find_start_re('re.txt')
执行结果:
单个处理数据和文
MySQL修改数据(超详细)
更新/修改数据
只改想改的数据: update 表名 set 字段名=值 where 条件子句; 如:
update c1 set name="库里30" where id=1;
修改全部数据:
update 表名 set 字段名1=值1,字段名2=值2...,字段名n=值n;
对于NULL不能用=符号,要用is null
修改表结构: alter table 表名 修改的动作语法; 如:
alter table c1 modify nam