Ted's Blog

Happy coding

删除空行

Ted posted @ 2008年8月04日 23:40 in 未分类 with tags vim grep , 3415 阅读

 

grep -v ^$ oldfile > newfile

 

vim的命令为:%s/^\n//g

如果有多个连续的空行,想保留一个
vim的命令为:%s/^\n$//g

删除多余的空格
行末:$     
行首:^
空格:\s
行末空格:\s\+$
行首空格:^\+\s
有些人认为行末的空格是无用,浪费而难看的。要删除这些每行后面多余的空格,可以
执行如下命令:
        :%s/\s\+$//

 

刪除沒有內容的空行
g/^$/d

刪除包含有空格組成的空行
g/^\s*$/d

除以空格或tab開頭到結尾的空行
g/^[ |\t]*$/d

 

Avatar_small
farhan 说:
2020年12月23日 13:10

I am always searching online for articles that can help me. There is obviously a lot to know about this. I think you made some good points in Features also. Keep working, great job ! wood pellets indonesia

Avatar_small
farhan 说:
2020年12月23日 19:52 Cool you write, the information is very good and interesting, I'll give you a link to my site. asuransi jiwa allianz
Avatar_small
farhan 说:
2020年12月23日 20:01

Your music is amazing. You have some very talented artists. I wish you the best of success. konsultan sekolah pilot

Avatar_small
farhan 说:
2020年12月23日 20:07

i never know the use of adobe shadow until i saw this post. thank you for this! this is very helpful. jual beli bisnis

Avatar_small
farhan 说:
2020年12月30日 02:20

This was among the best posts and episode from your team it let me learn many new things. 토토사이트

Avatar_small
farhan 说:
2021年1月01日 17:56

I see the greatest contents on your blog and I extremely love reading them. webmazer

Avatar_small
sophie 说:
2021年1月28日 02:10

I was taking a gander at some of your posts on this site and I consider this site is truly informational! Keep setting up..  Order Dexedrine Online

Avatar_small
sophie 说:
2021年1月31日 01:00

I don’t think many of websites provide this type of information.  budapest Immobilien

Avatar_small
sophie 说:
2021年2月03日 16:26

A good blog always comes-up with new and exciting information and while reading I have feel that this blog is really have all those quality that qualify a blog to be a one.  upload mp3

Avatar_small
sophie 说:
2021年2月05日 19:19

Writing with style and getting good compliments on the article is quite hard, to be honest.But you've done it so calmly and with so cool feeling and you've nailed the job. This article is possessed with style and I am giving good compliment. Best!  cheap smm panel

Avatar_small
review for android s 说:
2021年2月06日 21:09

I really thank you for the valuable info on this great subject and look forward to more great posts

Avatar_small
hire dedicated java 说:
2021年2月09日 18:16

It's late finding this act. At least, it's a thing to be familiar with that there are such events exist. I agree with your Blog and I will be back to inspect it more in the future so please keep up your act.

Avatar_small
instagram followers 说:
2021年2月11日 17:44

You completed certain reliable points there. I did a search on the subject and found nearly all persons will agree with your blog.

Avatar_small
Custom cartoon/super 说:
2021年2月14日 00:03

You completed certain reliable points there. I did a search on the subject and found nearly all persons will agree with your blog.

Avatar_small
vegan protein 说:
2021年2月15日 18:10

Really impressed! Everything is very open and very clear clarification of issues. It contains truly facts. Your website is very valuable. Thanks for sharing.

Avatar_small
serviced residence i 说:
2021年2月17日 18:58

A good blog always comes-up with new and exciting information and while reading I have feel that this blog is really have all those quality that qualify a blog to be a one.

Avatar_small
beginners 说:
2021年2月22日 15:08

Three are usually cheap Ralph Lauren available for sale each and every time you wish to buy.

Avatar_small
Chaussures feminine 说:
2021年2月22日 21:24

Its as if you had a great grasp on the subject matter, but you forgot to include your readers. Perhaps you should think about this from more than one angle.

Avatar_small
high quality cbd 说:
2021年2月24日 15:06

Discovering great quality articles online is somewhat troublesome now, yet I know somebody who will reveal to you about the altopdftojpg.com best articles. You can peruse these articles, and it will be an extraordinary time for you.

Avatar_small
practice butterfly k 说:
2021年2月26日 19:57

Three are usually cheap Ralph Lauren available for sale each and every time you wish to buy.

Avatar_small
kids back scratcher 说:
2021年5月04日 19:55

The writer has outdone himself this time. It is not at all enough; the website is also utmost perfect. I will never forget to visit your site again and again.

Avatar_small
Top SEO 说:
2021年9月16日 13:18

This post is very simple to read and appreciate without leaving any details out. Great work! kuliah

Avatar_small
net worth 说:
2022年3月23日 19:47

I learned a lot from the insight you shared here. It's good to learn more about this topic, and if you have some free time or you're curious about some celebrity basic information, you can visit idol net worth and search for it.

Avatar_small
https://www.arvoituk 说:
2022年8月16日 01:31

There are plenty of dissertation web pages internet as you're get hold of of course revealed in the web-site.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter