I've got a bash script that outputs results with pretty bash colors colours and I need to include the output with colors in a word document.

I would like to avoid putting a screenshot as the ouput is lenghty. I also don't really want to go through the pain of adding colours manually in word so I am looking for an easy way to copy the text with colours in putty and paste into word with colours.

Thanks for your help.

link|improve this question
1  
Not really a programming question. Try Super User? – Rafe Kettler May 16 '11 at 1:21
I guess it's border line as it is more to document stuff, I'll look over there thanks. – Philippe May 16 '11 at 1:40
feedback

migrated from stackoverflow.com May 17 '11 at 19:06

This question came from our site for professional and enthusiast programmers.

1 Answer

You'll need to do a two stage conversion, first to HTML then to Word. Try something like ansi2html, or Ansifilter and then copy pasta from a browser into Word, generating a PDF from HTML should also be trivial. (ask if you need info)

Also, a note to people voting to close / move this question. FWIW, other bash output to HTML questions are here on SO.

link|improve this answer
ansi2html is what i needed, it works as a charm, thanks – Philippe May 16 '11 at 6:41
"They do it wrong, so I'm going to do it wrong too" is rarely a valid excuse. – Ignacio Vazquez-Abrams May 17 '11 at 19:14
@Ignacio Vazquez-Abrams, "They weren't moved, so why should this one" ... is actually more the point. – slomojo May 18 '11 at 4:47
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.