Seperating each output onto a new line

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Hal300
Posts: 5
Joined: 2018-01-22T23:06:29-07:00
Authentication code: 1152

Seperating each output onto a new line

Post by Hal300 »

Hi. I'm using ImageMagick-7.0.7-22-Q16-x64-dll.exe to convert an image into it's coordinates form. I managed to convert it correctly but I am having a few issues. Firstly, all the coordinates are being output to the command window in one line. What is the command line text that I need to add so that each set of coordinates print on a new line? Also, there are so many coordinates that when I finish the command window doesn't keep them all and I can only scroll up so far. Is there any way to avoid this so I have all of the coordinates? Maybe to output the information into notepad? Thank you for any help.

Update: the command line code I'm using to convert the image is magick image.png sparse-color:
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Seperating each output onto a new line

Post by fmw42 »

In Unix, you can do

Code: Select all

magick image.png sparse-color: | tr " " "\n" > colors.txt
This will replace the spaces with new lines and redirect the output to a text file.
Hal300
Posts: 5
Joined: 2018-01-22T23:06:29-07:00
Authentication code: 1152

Re: Seperating each output onto a new line

Post by Hal300 »

Hi fmw42. Thank you for the help but I should of specified before hand. I am using Windows 7 and when I tried using 'tr' it gave me an error. Is there any other solution available?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Seperating each output onto a new line

Post by fmw42 »

I do not know the Windows equivalent of the unix tr. It just changes one character (a space) to another (a new line). You could search Google to see if there is such a command. Or search Google for the Windows methods of changing one character to another. Sed (in unix) also works. Perhaps there is some regex tool for Windows to change characters.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Seperating each output onto a new line

Post by snibgo »

Most, or probably all, the common Unix text processing tools are also available for Windows.
snibgo's IM pages: im.snibgo.com
Post Reply