Re: Regular expression with grep
bruce <[email protected]>
| Newsgroups | gmane.org.user-groups.aclug.linux-help |
|---|---|
| Message-ID | <20030327003111.XHHM25910.lakemtao08.cox.net@there> |
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. bruce -- This is the [email protected] list. To unsubscribe, visit http://www.complete.org/cgi-bin/listargate-aclug.cgi