切在Windows相当于

编程入门 行业动态 更新时间:2024-10-10 01:17:06
本文介绍了切在Windows相当于的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我也有条目下面的文件。

/ 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/p

I 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.txt

And 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.txt

The escaped percent signs are simplified and, as from command line the echo off is not enabled by default, the @ before echo is needed

更多推荐

切在Windows相当于

本文发布于:2023-11-26 23:43:16,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1635689.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Windows

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!