I have a batch file that would have something like this:
50-A Description of the item $23
I have a script that extracts whatever is before the $
sign, but I need to extract everything after the $
sign.
Here's the script:
for /f "tokens=1 delims=/" %%a in (test.txt) do (echo %%a >> newfile.txt)
How would I change it?
No matter how many $
you have in the line, you can easily get the text after the last one like so:
set "str=Te$ting thi$ $cript for $zero"
set "result=%str:$=" & set "result=%"
echo %result%
Your result in this case would be zero
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With