Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 500MB 的文件,它有字符串:
string_1 ..... string_500,
我需要生成此文件的副本,其中包含:
string_501.......string_1000
我需要在 string_500000 之前执行此操作,解决此问题的最佳方法是什么?
如果它真的如您所描述的那样,一个带有可变后缀的常量字符串然后只是生成新文件而忘记旧文件。
如果真的是
wibble_1 something_2 that_3 changes_4 randomly_5
我会在 perl 中阅读并解析内容
如果你只想生成一个字符串序列(string_501 到 string_500000),你可以这样做:
for i in `seq 501 500000` do echo string_${i} done