Board logo

标题: [文本处理] 【已解决】批处理获取文本每行逗号前的电话号码 [打印本页]

作者: winsfly    时间: 2020-7-31 12:47     标题: 【已解决】批处理获取文本每行逗号前的电话号码

批处理获取文本每行逗号前的电话号码
作者: winsfly    时间: 2020-7-31 13:40

回复 1# winsfly
  1. for /f "tokens=1 delims=," %%a in (1.txt) do (echo,%%a >>2.txt)
复制代码

作者: Batcher    时间: 2020-7-31 14:06

回复 1# winsfly
  1. @echo off
  2. (for /f "delims=," %%a in ('type "1.txt"') do (
  3.     echo,%%a
  4. ))>"2.txt"
复制代码

作者: ivor    时间: 2020-7-31 16:59

  1. powershell "[regex]::Matches([System.IO.File]::ReadAllText('1.txt'),'\d{11}(?=,)').Value"
复制代码





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