我使用csplit将复杂的文件划分file.docked.pdb
为小文件。
csplit -k -s -n 3 -f file.docked. file.docked.pdb '/^ENDMDL/+1' '{'7'}'
man csplit
完美地解释了以下代码
NAME
csplit - split a file into sections determined by context lines
-k, --keep-files
do not remove output files on errors
-s, --quiet, --silent
do not print counts of output file sizes
-n, --digits=DIGITS
use specified number of digits instead of 2
-f, --prefix=PREFIX
use PREFIX instead of 'xx'
Each PATTERN may be:
/REGEXP/[OFFSET]
copy up to but not including a matching line
{*} repeat the previous pattern as many times as possible
我的疑问是输出文件开始从中命名file.docked.000
并向前扩展
如何使编号从file.docked.001
???开始
如果工具根本不支持此功能,请提供解决方法。
第一个文件输出文件的索引始终为0,并且没有更改起始索引的选项。
解决方法是,在输出数据之前,可以使用过程替换将模式打印一次。这样,该虚拟行将拆分为文件file.docked.000
,然后可以将其删除。也可以将重复模式增加一倍,以获得所需数量的输出文件。
csplit -k -s -n 3 -f file.docked. \
<(echo "ENDMDL dummy, delete this file"; cat file.docked.pdb) '/^ENDMDL/+1' '{8}' &&
rm file.docked.000
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句