Fix typescript files generated with script command

Generally quite a lot of us would have used the script command. This generates the logs for the session. But the problem with the logs is that it contains a lot of un-readable characters. These characters are mostly from the color codes, and as such can be removed very easily with a single command:

cat typescript | 
 perl -pe 's/e([^[]]|[.*.*?[a-zA-Z]|].*?a)//g' | col -b > typescript-processed

This assumes the input log file is named as typescript and the output is kept as typescript-processed. You can change the names as required.



Enhanced by Zemanta

remove the background the easy way — online

Here is a nice link to web application that lets you remove the unwanted background. Just head over to the side, follow the simple instructions of marking the background and the subject and you are done.

Pretty good results you will get here, you may need to do a little work on the results but otherwise pretty good results.


Enhanced by Zemanta

create text tables from delimited files.

To create simple text tables to paste in emails or to use in any other document where you want to show a table, here is something that you can use. There is a perl module which provides “tablify“. And here is how to use it:

sudo yum install perl-Text-RecordParser

This will install a command “tablify” that you can use in number of ways. Here is a simple example to use it. You can read the man pages to see how you can use it.

: tmp ; cat < 
1	2001
2	3001
3	5001
4	1001

: tmp ; tablify --no-headers 
| Field1 | Field2 |
| 1      | 2001   |
| 2      | 3001   |
| 3      | 5001   |
| 4      | 1001   |
4 records returned

Enhanced by Zemanta