Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

grep for ^Z (ASCII code) in a file 2

Status
Not open for further replies.

bgreen

Programmer
Feb 20, 2003
185
CA
Hi,

I am trying to grep for the ascii character in a file but I am not sure how. I know this is 1 character long. I am trying:

grep "^Z" file

this does not work.
 
You may try this:
grep `echo "\032\c"` file

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Code:
egrep "\r" *.txt
works on my AIX 5.1 system

Columb Healy
 
Ooops - please ignore my stupid faux pas! I'm so used to fixing what my users call 'the Control M problem' I didn't read the original post closely enough.

Columb Healy
 
Alternatively just type:

[tt]grep ^V^Z file[/b]

^V^Z is Ctrl-V followed by Ctrl-Z. You may not even need the Ctrl-V (I don't).

Annihilannic.
 
I used PHV's idea. It worked. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top