Monday, March 14, 2016

Re: delete chinese character quickly

在 2016年3月13日星期日 UTC+8下午7:51:43,Yang Luo写道:
> this is a subtitle.srt, I want to delete all the Chinese character(like this:距离地球4亿英里,存在这一个迷你太阳系,), how can I do it using vim command?
> I know dd can delete a line, but there are too many liens.
>
> 1
> 00:00:03,400 --> 00:00:07,730
> 距离地球4亿英里,存在这一个迷你太阳系,
> Four hundred million miles from Earth, exists a mini solar system
>
> 2
> 00:00:07,760 --> 00:00:12,390
> 60多个卫星围绕着一个强大的气态行星旋转。
> of over 60 moons rotating around a powerful planet of gas.
>
> 3
> 00:00:17,770 --> 00:00:20,980
> 它流动的颜色和斑点保持了奇异的美景,
> Its flowing colors and spots hold strange beauty,
>
> 4
> 00:00:21,530 --> 00:00:24,390
> 然而也包含了强烈的风暴、喷射气流。
> but contain violent storms and jet streams.

%s/[^\x00-\xFF]//g

or, even better:

g/[^\x00-\xff]/d

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: