Redian新闻
>
regular expression中回车用什么表示?
avatar
regular expression中回车用什么表示?# Unix - 噫吁兮,危乎高哉
F*Q
1
要查找文件中的特定的行末标志比如
0
40
能否用regular expression来查找,就向word中的^p一样
thx!
avatar
m*e
2
know C? '\n'

【在 F***Q 的大作中提到】
: 要查找文件中的特定的行末标志比如
: 0
: 40
: 能否用regular expression来查找,就向word中的^p一样
: thx!

avatar
F*Q
3
但是我用
grep '0\n40\n' myfile
却找不到:(

【在 m*****e 的大作中提到】
: know C? '\n'
avatar
m*e
4
1. which grep are you using? You should use GNU grep or egrep.
2. make sure your lines do not end with '\r\n' like most files
edited under DOS

【在 F***Q 的大作中提到】
: 但是我用
: grep '0\n40\n' myfile
: 却找不到:(

avatar
c*t
5
hmm, I don't think that egrep can do that either. It buffers
only a line.

【在 m*****e 的大作中提到】
: 1. which grep are you using? You should use GNU grep or egrep.
: 2. make sure your lines do not end with '\r\n' like most files
: edited under DOS

avatar
F*Q
6
I use AIX 4.3
both grep and egrep give me the first line of the file when
i use
?grep '\n' myfile
but can't find all of the lines,also,the specified line I
am searching
sed even dosen't accept '\n':(

【在 c*****t 的大作中提到】
: hmm, I don't think that egrep can do that either. It buffers
: only a line.

avatar
m*e
7
No idea. GNU grep works for me on both Linux and Solaris.

【在 F***Q 的大作中提到】
: I use AIX 4.3
: both grep and egrep give me the first line of the file when
: i use
: ?grep '\n' myfile
: but can't find all of the lines,also,the specified line I
: am searching
: sed even dosen't accept '\n':(

avatar
t*l
8
sed -n '/0$/{N;/04$/p}' yourfil

【在 F***Q 的大作中提到】
: 但是我用
: grep '0\n40\n' myfile
: 却找不到:(

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