Page 1 of 1
Seperating each output onto a new line
Posted: 2018-01-22T23:17:16-07:00
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:
Re: Seperating each output onto a new line
Posted: 2018-01-23T00:08:13-07:00
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.
Re: Seperating each output onto a new line
Posted: 2018-01-23T03:56:19-07:00
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?
Re: Seperating each output onto a new line
Posted: 2018-01-23T10:29:58-07:00
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.
Re: Seperating each output onto a new line
Posted: 2018-01-23T10:47:03-07:00
by snibgo
Most, or probably all, the common Unix text processing tools are also available for Windows.