我也有条目下面的文件。
/ A / B / C / D / E / F/ A / B / C / G / K / L / F / J / h的/ A / B / C / I / M / N / P我需要在Windows命令将其删除/ A / B / C部分从文件。
输出文件应该看起来像
D / E / F 克/ K / L / F / J / h的 I / M / N / P
我尝试使用与命令/作为分隔符,但不能得到预期的结果。任何人都可以请帮助?
解决方案 关闭@echo(FOR / F令牌= 3,* delims = /%%一中(input.txt中)做回声%% B)> output.txt的和的绝招是问第三令牌和行的其余部分。
要直接在命令行中使用它。
(FOR / F令牌= 3,* delims = /,在(input.txt中)做@echo%B%A)GT; output.txt的转义百分号简化工作,并从命令行呼应了默认不启用, @ 在回声需要
I have a file which has entries as below.
/a/b/c/d/e/f /a/b/c/g/k/l/f/j/h /a/b/c/i/m/n/pI need a command in windows which would remove the '/a/b/c' part from the file.
The output file should look like
d/e/f g/k/l/f/j/h i/m/n/p
I tried using for command with / as delimiter, but couldn't get the expected result. can anyone please help?
解决方案 @echo off (for /f "tokens=3,* delims=/" %%a in (input.txt) do echo %%b) > output.txtAnd the "trick" is to ask for the third token and the rest of the line.
To use it directly from command line
(for /f "tokens=3,* delims=/" %a in (input.txt) do @echo %b) > output.txtThe escaped percent signs are simplified and, as from command line the echo off is not enabled by default, the @ before echo is needed
更多推荐
切在Windows相当于
发布评论