Answer the question
In order to leave comments, you need to log in
How to remove dashes in text document?
There is a text document rotor.txt
It contains lines with dashes
N-34;N-30A-b;N-20;
N34;N30Ab;N20;
Answer the question
In order to leave comments, you need to log in
In order to give something to compare to the res2001 answer : Decide for yourself which is harder and which is easier
Posh
(get-content old.txt -raw) -replace "-","" | set-content new.txt
powershell.exe "(get-content old.txt -raw) -replace '-','' | set-content new.txt"
Now there is no Windows at hand, I did not test it.
@echo off
Setlocal EnableDelayedExpansion
for /f "tokens=* delims=" %%a in (rotor.txt) do (
set "val=%%a"
set "val=!val:-=!"
>>rotor_new.txt echo.!val!
)
set /?
for /?
setlocal /?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question