【问题标题】:String manipulation using batch使用批处理的字符串操作
【发布时间】:2013-07-17 16:28:47
【问题描述】:

下面是我的批处理脚本的 crud 输出

"kxip12","triss-s16-vm","","triss-db02-vm","false","true","false","MySQL","false"," "," ","PTROWEUTIL","PTROWETP","false","172.17.6.167:7081,172.17.6.248:7081,172.17.1.93:7081,172.17.6.167:7081","64","18","18","512"," "," ","true","FOO","BAR","RAID:12345",""," ","","tp.cfg:TP.remotedInterface.active=FALSE","tp.cfg:TP.LoopBackDestination.Count=1","tp.cfg:TP.trading.orderHistoryReflected=true","tp.cfg:TP.glueInterface.acceptorService_tcp=gatedev28z3.itgssi.com:32101","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""

我只想要"kxip12" 作为o/p。我在 bash 中寻找类似于 awk 的东西。

【问题讨论】:

    标签: windows csv for-loop batch-file cmd


    【解决方案1】:

    试试这个:

    (for /f "delims=," %%a in (file.csv) do echo(%%a)>filenew.csv
    

    你最好使用awk for Windows

    【讨论】:

      【解决方案2】:
      for /f %%a in (%str%) do set first=%%a
      set first=%first:"=%
      

      【讨论】:

      • @echo off set /p serv=SenderCompID? echo %serv% > servers11.txt for /F "delims=;" %%i in (servers11.txt) do ( type \\triss-s02-vm\ITG\Triton\GroupConfig.csv | grep -i %%i >temp12.txt setlocal enableextensions enabledelayedexpansion set first=1 for /f "delims =" %%i in (temp12.txt) do ( if !first!==1 echo %%i set first=0 ) endlocal pause )
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-05-15
      • 1970-01-01
      • 1970-01-01
      • 2017-04-20
      • 1970-01-01
      • 2019-12-13
      相关资源
      最近更新 更多