Java Swing help in Applications & Coding Posted December 6, 2014 · Edited December 6, 2014 by TGYK I'd just pipe the output to sed, get rid of the extra characters and whitespace, and write these to a file. If you are reading this file from Java while you are still writing to it, make sure to open the file in read only mode. Best regards, Sebkinne Sed only recognizes the [2K part, not the ANSI Esc sequence. Tail doesn't realize that there is more than one line in the file. My intention is to move from using files, to just piping the output of pianobar straight into a fifo which Java opens to read, but I'd like to figure out how to get rid of these control characters first. Edit: As far as I can tell, Pianobar does not have any options to disable this feature, as it was designed to be a terminal application, and the control codes handle the 'display' of the application. Edit 2: After mucking around with sed and awk and even trying perl, I'm a bit confused, thinking maybe these programs don't recognize the ANSI escape sequence, whether represented as \e, \033, or \1B. I'm considering doing away with the bash parsing entirely, and recreating it all in code in Java. I'd need a way to strip terminal control codes, then a way to match the last line containing a # character. As this has drifted far away from my original problem of SwingWorker issues, I may delete this thread and make a new one pertaining to my new issues, unless it's alright to go so far off topic here. I'm open to suggestions on how to remove the control codes, and thanks for the help so far!