I have a text file that contains lots of values on multiple lines with a different amount of spaces between values. Some spacing is 4, 6, 7, 9, etc. I have this code written but it only works for removing odd numbers of spaces (and leaving one space) which means that if I have 4 spaces between values (an even amount) I have no required space left.
Edit: max spacing is 13 and values per line are not the same.
Example text file:
123.000 345.555 @ 777.4560000 1.55555 66.878444
333.444 555.4848 999.758584 | 34.3737373
This is what I want after the fix:
123.000 345.555 777.4560000 1.55555 66.878444
333.444 555.4848 999.758584 34.3737373
This is what I am getting with my code below:
123.000345.555 777.45600001.55555 66.878444
333.444555.4848 999.758584 34.3737373
How do I set spacing to one space between every value regardless of the amount of spaces? I am also removing the @ and | symbols as well.
@echo off
setlocal EnableExtensions DisableDelayedExpansion
> "conv_output_clean.txt" (
for /F "usebackq delims=" %%L in ("conv_output.txt") do (
set "LINE=%%L"
setlocal EnableDelayedExpansion
set "LINE= !LINE: =!"
set "LINE=!LINE:@=!"
set "LINE=!LINE:|=!"
echo(!LINE!
endlocal
)
)
endlocal
exit /B