Board logo

标题: [文本处理] 如何批处理删除txt文档的首行以及内容中的逗号? [打印本页]

作者: gisjun    时间: 2011-3-8 16:38     标题: 如何批处理删除txt文档的首行以及内容中的逗号?

我是个p处理新手,请问大侠,如何批处理删除txt文档的首行以及内容中的逗号,谢谢了!
作者: lxzzr    时间: 2011-3-8 16:50     标题: 回复 1楼 的帖子

简单的

  1. @echo off
  2. setlocal enabledelayedexpansion
  3. for /f "skip=1 delims=" %%a in ('type 1.txt') do (
  4. set "string=%%a"
  5. echo !string:,=!
  6. )
  7. pause
复制代码

作者: Batcher    时间: 2011-3-8 19:16

  1. sed -i "1d; s/,//g" 1.txt
复制代码

作者: gisjun    时间: 2011-4-3 22:39

非常感激各位好心人!




欢迎光临 批处理之家 (http://bbs.bathome.net/) Powered by Discuz! 7.2