想用文本修改一个文件里的一些内容,但这个文件太大600m或更大,所以我希望用python单独读取其中的一部分内容进行修改,原文件前12行如下:
//Maya ASCII 2011 scene
//Name: maformat.ma
//Last modified: Thu, Jun 03, 2010 10:10:55 AM
//Codeset: 936
requires maya "2011";
requires "Mayatomr" "2011.0m - 3.8.1.26 ";
currentUnit -l centimeter -a degree -t film;
fileInfo "application" "maya";
fileInfo "product" "Maya 2011";
fileInfo "version" "2011 Hotfix 1 x64";
fileInfo "cutIdentifier" "201004290308-773275";
fileInfo "osv" "Microsoft Windows 7 Ultimate Edition, 64-bit Windows 7 (Build 7600)\n";
.
.
.
我需要将前12行改成这样:
//Maya ASCII 2011 scene
//Name: maformat.ma
//Last modified: Thu, Jun 03, 2010 10:10:55 AM
//Codeset: 936
requires maya "2009";
requires "Mayatomr" "2009 - 3.7.1.26 ";
currentUnit -l centimeter -a degree -t film;
fileInfo "application" "maya";
fileInfo "product" "Maya 2009";
fileInfo "version" "2009 x64";
fileInfo "cutIdentifier" "201004290308-773275";
fileInfo "osv" "Microsoft Windows 7 Ultimate Edition, 64-bit Windows 7 (Build 7600)\n";
.
.
.
后面内容不作修改
请告诉我如何用python修改,谢谢