/** * @创建日期 2013-07-15 * @创建时间 14:25:59 * @版本号 V 1.0 */ public class CosTest { public static void main(String[] args) { String sql = "select * from teacher where id = ? and name = ?"; System.out.println(replaceString(sql
假设有文件test.txt,想把test.txt文件第三列含有的good替换为bye,并把替换后的文件保存为test_bye.txt,只需要如下命令. test.txt go go good go my my go good bye my good bye test_bye.txt go go bye go my my go good bye my bye bye awk -F " " '{if ($3==good) $3=bye}1' test.txt > test_bye.t
下面的例子是在文件的指定位置增加指定字符串的例子 修改配置文件: def add_str(pre_str): lines = [] flag = True f = open("z.txt") for line in f: lines.append(line) if line.strip("\n ") == "</se.diabol.jenkins.pipeline.DeliveryPipelineView>" and flag: li