I am executing command and parsing the command based on space, Formatting it and storing in a file.
This is how I have written the batch script
for /f "tokens=2,4,5" %G IN ('command') DO echo Id:%%G:~0,-1% Timestamp:%H %I > C:\Users\TJ\Documents\out1.txt
I am getting the output like this
Id:3495068:~0,-1; Timestamp:2023/01/25 14:57:18
But I am trying to trim the ";" semicolon but it's not trimmimg instead it's adding the trim logic to output.
I am expecting output like.
Id:3495068 Timestamp:2023/01/25 14:57:18
Is anything I am missing here.