avatar
请问几个关于Sed的问题# Unix - 噫吁兮,危乎高哉
s*a
1
Make a new file which contains all of the lines that do not
contain a numeric character.
我用sed -n '/[0-9]/!p' filename 可是不work
Make a new file which replaces any line with a numeric character
with a line of three X's "XXX"
这个是怎么弄呢?跟substitute又不是一回事,查notes也查不到
Make a new file which adds a new line (three X's) before each line
that contains a numeric character.
Make a new file which contains all lines that have a capital alphabetical
character in the original file.
偶notes , google了半天都查不到,大侠帮帮忙。
avatar
a*s
2
I use tcsh.

sed -e /[0-9]/d filename
don't know how to just use only line to do it.
don't know how to just use only line to do it.
I don't know how to easily express non-capital alphabetical character
in "sed".
Is "grep" acceptable?
grep "^[A-Z]" filename

【在 s******a 的大作中提到】
: Make a new file which contains all of the lines that do not
: contain a numeric character.
: 我用sed -n '/[0-9]/!p' filename 可是不work
: Make a new file which replaces any line with a numeric character
: with a line of three X's "XXX"
: 这个是怎么弄呢?跟substitute又不是一回事,查notes也查不到
: Make a new file which adds a new line (three X's) before each line
: that contains a numeric character.
: Make a new file which contains all lines that have a capital alphabetical
: character in the original file.

avatar
m*h
3
why not use awk?

【在 s******a 的大作中提到】
: Make a new file which contains all of the lines that do not
: contain a numeric character.
: 我用sed -n '/[0-9]/!p' filename 可是不work
: Make a new file which replaces any line with a numeric character
: with a line of three X's "XXX"
: 这个是怎么弄呢?跟substitute又不是一回事,查notes也查不到
: Make a new file which adds a new line (three X's) before each line
: that contains a numeric character.
: Make a new file which contains all lines that have a capital alphabetical
: character in the original file.

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。