Read a CSV file into columns

May 6th, 2016

This command will read a CSV file, and display it as columns. This also works on Windows if you have Cygwin installed.

column -t -s"," test.csv

Example CSV columns

MySQL Dump And Restore Database Table With Compression

August 30th, 2014

mysqldump --no-create-info -uxxxx -pxxxx Database ATable | gzip -9 > xxxx.sql.gz

zcat xxxx.sql.gz | mysql -uxxxx -pxxxx Database

PHP Class To Color CLI Output

July 31st, 2013

A guy named JR posted this nifty piece of code to help color CLI output in bash from PHP scripts

And this user on GitHub cleaned it up a bit and posted a Gist of it.

Strip Whitespace Out Of A File

June 6th, 2013

sed is a wonderful tool. Just used this command today to remove most of the whitespace from a file.

sed 's/ //g' test.txt > test2.txt

Making A USB Hard Drive Bootable

June 25th, 2011

Vista and Windows 7 DVDs include a utility to make a USB hard drive bootable so you can install from them.

The command for this is:
[code]E:\boot\bootsect.exe /nt60 F:[/code]
where E is the DVD drive, and F is the hard drive that you want bootable.

Once you’ve done this, you can copy the contents of the DVD to the USB hard drive, and install from that. Great for when you didn’t buy a SATA DVD drive for your new computer 😀

WordPress - Entries (RSS) and Comments (RSS) - © 2011 Ben Dauphinee