In Cmd.exe, how do I keep only the number after an equal sign in a text file?
Input file (input.txt) looks like...
Line1=1.234 开发者_StackOverflow社区 Line2=5.432 . . Line10=3.456I want the outuput file (output.txt) to look like...
1.234 5.432 . . 3.456Thank you for your help.
This should do it:
FOR /F "delims== tokens=2" %%a IN (input.txt) DO @ECHO %%a >> output.txt
You would need to manipulate the input file in a Batch file. Here are some tips on string manipulation commands:
http://www.dostips.com/DtTipsStringManipulation.php
With sed:
sed "s/^line[0-9]\+=//g" input.txt > output.txt
精彩评论