简体   繁体   中英

Emacs, searching for something that is seperated by a newline

I have some data files that end up having pesky erroneous lines. For example, in the following file:

data, A, 1, B, 2
,
,
,
,
,
data, A, 4, B,5

I want to get rid of the five comma only lines. What search string do I enter into emacs to find these?

Try this:

M-x flush-lines RET ^,$ RET

where RET means hit Return(or Enter) key. You can read this page for more detail.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM