[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[文本处理] 如何用批处理删除一批文件中的特定字符

X-Newsreader: rusnews v1.02
Lines: 50
[email=jaeger@buphy.bu.edu]jaeger@buphy.bu.edu[/email] (Gregg Jaeger) writes:
>In article <[email=11847@vice.ICO.TEK.COM]11847@vice.ICO.TEK.COM[/email]> [email=bobbe@vice.ICO.TEK.COM]bobbe@vice.ICO.TEK.COM[/email] (Robert
>Beauchaine) writes:
>>Bennett, Neil.  "How BCCI adapted the Koran rules of banking".  The
>>Times.  August 13, 1991.
>
> So, let's see. If some guy writes a piece with a title that implies
> something is the case then it must be so, is that it?
Gregg, you haven't provided even a title of an article to support *your*
contention.
>>  This is how you support a position if you intend to have anyone
>>  respect it, Gregg.  Any questions?  And I even managed to include
>>  the above reference with my head firmly engaged in my ass.  What's
>>  your excuse?
>
> This supports nothing. I have no reason to believe that this is
> piece is anything other than another anti-Islamic slander job.

请教:
        一文件夹中有一批文件 内容如上 可以用记事本打开 怎么删除每行开头的“>”字符(仅是开头的) 批处理怎么实现

回复 6楼 的帖子

能实现
你自己试试就知道了
我帮忙写的代码不需要付钱。如果一定要给,请在微信群或QQ群发给大家吧。
【微信公众号、微信群、QQ群】http://bbs.bathome.net/thread-3473-1-1.html
【支持批处理之家,加入VIP会员!】http://bbs.bathome.net/thread-67716-1-1.html

TOP

回复 3楼 的帖子

如果要删除的字符是"有没有可能实现?

TOP

回复 3楼 的帖子

gawk版:
  1. gawk "{gsub(/^>+/,\"\",$0);print}" a.txt
复制代码
我帮忙写的代码不需要付钱。如果一定要给,请在微信群或QQ群发给大家吧。
【微信公众号、微信群、QQ群】http://bbs.bathome.net/thread-3473-1-1.html
【支持批处理之家,加入VIP会员!】http://bbs.bathome.net/thread-67716-1-1.html

TOP

回复 3楼 的帖子

sed还可以这样:
  1. sed -i "s/^>\{1,\}//g" a.txt
复制代码
我帮忙写的代码不需要付钱。如果一定要给,请在微信群或QQ群发给大家吧。
【微信公众号、微信群、QQ群】http://bbs.bathome.net/thread-3473-1-1.html
【支持批处理之家,加入VIP会员!】http://bbs.bathome.net/thread-67716-1-1.html

TOP

gawk 版的硬是搞不出来,谁会?帖个代码出来?
  1. @sed ":c;s/^>//g;/^>/b c" a.txt>s.txt
复制代码
  1. @echo off
  2. (for /f "tokens=* delims=>" %%a in (a.txt) do echo,%%a)>s.txt
复制代码

[ 本帖最后由 随风 于 2009-5-31 02:54 编辑 ]
技术问题请到论坛发帖求助!

TOP

这个不会,帮你顶下,,。。。

TOP

返回列表