0

I'm trying to get a string from an url using a batch file.

String example:

e-e --ser u.g --p 3 --f 0 x,ss

I am using the command below to CURL output directly to a variable:

FOR /F %%I IN ('curl.exe -s -S %URL%') DO (SET W=%%I)

The problem is, when I echo the variable [W] after the command runs, most of the string is missing...

e-e

What is the best method to get around this issue?

1 Answer 1

1

By default, the FOR /F command delimits the output based on a space and tab. That is stated in the help file. To keep that from happening use the DELIMS option to tell the FOR command to not use any delimiters.

FOR /F "delims=" %%I IN ('curl.exe -s -S %URL%') DO (SET W=%%I)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.