在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
我想用批处理实现向s.txt中多次分别导入文本例如:“aaaa","bbbb","cccc","dddd" 答案: echo 做不到,不过可以执行以下语句到达到目的 复制代码 代码如下: >>s.txt set /p="aaaa" <nul >>s.txt set /p="bbbb" <nul >>s.txt set /p="cccc" <nul >>s.txt set /p="dddd" <nul s.txt的内容将是 aaaabbbbccccdddd 注2:关于set/p="aaaa"的详细内容请查看《set命令》 实例1: if exist %statFile2% ( >>%statFile2% set/p=,%%i<nul ) else ( >>%statFile2% set/p=%%i<nul ) 实例2 ----(个人添加) 复制代码 代码如下: @echo off del b.txt del c.txt del d.txt if exist "%cd%\zhI386" rd /s /q "%cd%\zhI386" md zhI386 ::for /r "%cd%\eni386\" %%i in (*) do (echo %%i>>b.txt) for /f %%i in ('dir /b %cd%\eni386\') do ( echo %%i>>c.txt if exist "%cd%\zhall\i386\%%i" (copy "%cd%\zhall\i386\%%i" "%cd%\zhI386\" ) else (>>d.txt set /p="zhall\i386\%%i"<nul&echo ----Not exist>>d.txt) ) windows批处理之六-echo输出不换行 复制代码 代码如下: @echo off set /p="hello "<nul set /p="world "<nul echo again echo new line Result: 应用: 复制代码 代码如下: echo off set csvpath=测试数据 set sqluldr=D:\sqluldr\sqluldr2sdk\sqluldr2 set sqlpath=导出模板 rem set filename=产品行情 rem sqluldr2 gtcustomer/passwd file=%csvpath%\%filename%.csv text=csv field=, sql=exp%filename%.sql log=%csvpath%\%filename%.log rem rem set filename=产品行情更新 rem sqluldr2 gtcustomer/passwd file=%csvpath%\%filename%.csv text=csv field=, sql=exp%filename%.sql log=%csvpath%\%filename%.log set expfpath=百万级 |
请发表评论