avatar
r*s
2
with enscript:
% enscript -a odd(or even) -o outputfile.ps inputfile.name

【在 r*u 的大作中提到】
: How to print the odd (or even) lines of a file to another file?
avatar
r*u
3
Thanks. Any way to do it without enscript?

【在 r*****s 的大作中提到】
: with enscript:
: % enscript -a odd(or even) -o outputfile.ps inputfile.name

avatar
c*t
4
1. use wc to count # of lines
2. generate odd #'s
3. create a sed script to delete those # lines

【在 r*u 的大作中提到】
: Thanks. Any way to do it without enscript?
avatar
r*u
5
Thanks. I found another sed command that can do this.
In a general case, beginning at line 3, print every 7th line,
sed -n '3,${p;n;n;n;n;n;n;}'
So I can modify it for printing odd or even lines.

【在 c*****t 的大作中提到】
: 1. use wc to count # of lines
: 2. generate odd #'s
: 3. create a sed script to delete those # lines

avatar
p*f
6

perl -pe'$_ x=$.&1'

【在 r*u 的大作中提到】
: How to print the odd (or even) lines of a file to another file?
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。