我喜欢使用 PERL 或 AWK 来完成这类任务。
$ perl -ne "print if $. > 4" TRIALCR.TXT [ > x.x ]
$
$ gawk /com="NR>4" TRIALCR.TXT [/output=x.x]
根据 user2116290 搜索已知存在的字符串也可以。对于最近的 OpenVMS 版本,对于这种特定情况,请考虑在不存在的字符串上搜索不匹配项并跳过 4 行。(搜索“”不匹配空行)
$ search TRIALCR.TXT;1 "@#$%" /match=nor /skip=4
吉姆在他的剧本中有一个很好的答案。如果您了解进程永久文件的工作方式,则可以进行很好的简化。让 DCL 吞下前 4 行,然后将其余行复制到目标文件。
$ close/nolog input
$ open/read/error=error input trialcr.txt
$ read/end=error/error=error input junk
$ read/end=error/error=error input junk
$ read/end=error/error=error input junk
$ read/end=error/error=error input junk
$ COPY input trialcr.txt
$ close input
$exit:
$ exit
$error:
$ write sys$output "Unexpected error: " + f$message ($status)
$ goto exit
享受,海因