Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Format output commandlines from cmd

Featured Replies

Hi guys,

 

I would like export the output of a command to a text file but with format. i.e. I need the output line to be each on a new line instead of having all lines side-by-side

 

Here is my batch:

echo.curl  -1 -X GET^    --cert signedIn.pem^    --header "Accept-Charset:UTF-8"^    --header "Accept:application/gooleMaps_v3_1_0+xml;charset=utf-8"^    --header "Accept-Encoding: deflate"^exit

the output is going to be:

curl  -1 -X GET   --cert signedIn.pem  --header "Accept-Charset:UTF-8"  --header "Accept:application/gooleMaps_v3_1_0+xml;charset=utf-8" --header "Accept-Encoding: deflate"^

I would like to have them as follow:

echo.curl  -1 -X GET^    --cert signedIn.pem^    --header "Accept-Charset:UTF-8"^    --header "Accept:application/gooleMaps_v3_1_0+xml;charset=utf-8"^    --header "Accept-Encoding: deflate"^

I would like to have both the input and the output to an external file. That is why, I copied the input command again in my batch then added "echo." before it.

 

I know that ">" export the output to an text file and ">>" append them to it.

 

any idea about how to do so?

Edited by xtremee

If you know what your required output is and you are writing the batch file yourself then just write the batch file properly.

@echo/echo.curl  -1 -X GET^^@echo/    --cert signedIn.pem^^@echo/    --header "Accept-Charset:UTF-8"^^@echo/    --header "Accept:application/gooleMaps_v3_1_0+xml;charset=utf-8"^^@echo/    --header "Accept-Encoding: deflate"@pause

Of course that would be too easy and is likely not the answer you want, is it?

 

…that's because, as is often the case, my guess is that  echo is not the command you are really running. That command is a secret; (the sort of secret which will prevent us from providing you with a solution).

 

So if I am correct, please save us all from pages full of answers of wasted guesswork in trying to help you and just tell us the real command and what you intend to do with the real output.

  • Author

There is no secret command, I am trying to do.

I already explained my target command in my previous post. In this post, I was trying to organize my command.

 

I have a question here:

echo. : creating an empty line

echo/: execute the command and show it on the screen. That is wrong, right?

^^: at the end of sentences, what should they do?

 

Thanks

The word echo need not be followed by the dot character, there are a few characters which are deemed to do the same, some even better. It is believed that the best character is an opening parenthesis, (, then possibly an equals symbol, =, then maybe a forward slash, /. More often than not you will not be able to tell any difference but some crazy batch guys over the years have argued their case and found less chance of errors with certain characters. So echo( creates an empty line; as does echo. and echo= and echo/

The circumflex character ^ is used as an escape character. As used in the output you were receiving, it was being used as a concatenation character because it was escaping the line feed; hence the reason your output was showing on one line. In order to output the required lines I had to escape the escape character, thus doubling it ^^.

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.