猴子原创,欢迎转载.转载请注明: 转载自Cocos2Der-CSDN,谢谢! 原文地址: http://blog.csdn.net/cocos2der/article/details/50595585 最近经常需要些一个编译工作脚本,经常操作一个文件.下面是一个汇总了的文件操作方法. using UnityEngine; #if UNITY_EDITOR using UnityEditor; using System; using System.IO; using System.Threadin
Linux下Python 文件替换脚本 import sys,os if len(sys.argv)<=4: old_text,new_text = sys.argv[1],sys.argv[2] file_name = sys.argv[3] f = open(file_name,"rb") new_file = open(".%s.bak" % file_name,"wb") for line in f.xreadlines(): pr
说明,是通过file2内容与file1做比较,最后列出file1与file2不同的部分! 一.准备两个文件: [root@kinggoo.com test1]# cat file1 a b c d e [root@kinggoo.com test1]# cat file2 c e 二.比较方法: 方法一:grep 命令 [root@kinggoo.com test1]# grep -v -f file2 file1 a b d 方法二:comm 命令 [root@kinggoo.com test