程序设计思路:1. 利用os.walk()找出所有的文件;2.利用正则找到指定后缀的文件:3.找到需要的txt文件后,通过open().readlines()读取文件中每行数据;4.读取后,保存正则匹配到数据的文件:5.你懂的. #!/usr/bin/env python #coding:utf8 import os import re regtxt = r'.+?\.txt' #扫描对象为txt文件. regcontent = r'what is your name' #列出内容含有'what…
操作流程: $ mysql -uroot -p mysql> use foo; mysql> select * from userinfo into outfile '/var/lib/mysql-files/uc3dp_v1.0_userinfo.txt' fields terminated by ', ' lines terminated by '\n'; 注意:上面命令中的路径不可以随意乱指定,如改成/tmp/uc3dp_v1.0_userinfo.txt就会报错: ERROR 1290…
1.方法1 public static void main(String[] args) { try { FileWriter fileWriter = new FileWriter("c:\\Result.txt"); String ss = "cName\t\cCode\t\tcreateDate\n"; ss += "dbc券\t\t111188\t\t2017-05-14\n"; ss += "zc券\t\t111199\t\t…