[linux-help] Re: Regular expression with grep
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Wednesday 26 March 2003 05:15 pm, you wrote:
> Have you tried "sed s/.$//" ?
> Since every line has EITHER an extra space OR an extra CR character,
> you can just use the wildcard.
> Obviously if some lines just have a word with a LF following it, this
> will not work. Then you would want to consider something
> like "s/[a-zA-z]$/&!/" to add a character to the lines that don't
> already have one.
Thanks Alden. That worked. I did a short visual search and couldn't
find any lines that didn't have two characters, but with 76,000 lines I
couldn't look at all. Now all I see have only LF.
Just for my own edification, is there any way to grep for a certain
non-printing ascii character? The Linux programming bible says \xyy
would find ascii yy, for instance \x07 finds the ascii bell. But I
wonder if maybe that only works in perl.
-- This is the linux-help@xxxxxxxxx list. To unsubscribe,