如何编辑40G以上的txt文件?

源mdx词典文件4G左右,解开后40G多。
手头上的文本编辑器都打不开。
如果需要对文科里面的代码进行批量操作,应该怎么做到?

1 Like

应该具体说你试过什么文本编辑器。

40G,理论上EmEditor可以打开。

EmEditor is optimized for handling large files, the kind of files that other editors just can’t handle. Files up to 16 TB can be opened in full using only a little bit of memory. For files even larger than that, EmEditor uses the Large File Controller to moderate how the program handles huge files.
https://www.emeditor.com/text-editor-features/large-file-support/

假如你的电脑ram不够,c盘也不够大,把临时文件夹移到别的够大的硬盘去。

If you are opening a file larger than this size, make sure there is enough disk space in the temporary file folder. The default temporary folder is the system temporary folder, specified by the %TEMP% environment variable. You can override the temporary folder to any folder you would like, that has enough space available.
https://www.emeditor.com/text-editor-features/large-file-support/files-up-to-248gb/

假如你准备尝试这个方法,可以看看以下文章:

How to Move Windows’ Temporary Folders to Another Drive
按:这个可能是Win 8。

Win 10
https://portal.perforce.com/s/article/3409
结论,至少在我用的Win10中,此路不通,能改,但是会被系统改回去。为了安全考虑吧。所以知识会过期的。

假如你的硬盘真不够大,C盘不够大,D盘也不行,可以考虑:

用程式把文件切成几块,每块编辑完后,再用程式黏回去。

网上有人推荐这个(我没用过):

Unified List Manager
https://unifiedlm.com/Home

不过要记得先备份了文件再玩。

1 Like

EmEditor
建议把文件拆小。比如拆成100个。
用在 文件在查找 可以找到目标文件,

如需替换,用 在文件在替换 能批量操作。
适合是少量、统一的修改
如有多个替换操作,可以用批处理。
缺点:必须小心操作,很容易出错的。做好充分备份。

1 Like