Friday, February 29, 2008

Import a CSV file into MySql

I recently received a CSV file that I needed to import into MySQL, I tried to use Navicat on a Windows machine but the file was large enough to cause it to hang. So I went to the command line on the server and created it as follows

mysqlimport --fields-terminated-by="," --fields-optionally-enclosed-by="\"" --lines-terminated-by="\n" databasename /pathtocsvfile/csv.csv -u mysqlusername -p

note that the name of the file I was importing was csv.csv, in order for this to work you must have created a table that will accept this data wit the same name as the file you are importing (minus the extension)

Thursday, February 28, 2008

Install Flex 2 Alpha for Linux on Ubuntu

Make sure you have a copy of Eclipse 3.3 Classic (Europa Installed)

Download this from http://www.eclipse.org/downloads/

Create a directory in your home file called eclipse3.3

Extract eclipse into this directory

Make sure you have the latest version of Java Installed (ie. Version 1.6)

and make sure it is set as the default Java sudo update-java-alternatives

Download Flex for Linux http://labs.adobe.com/technologies/flex/flexbuilder_linux/

chmod +x flex* (to allow you to execute the download file)

follow the installation process and select the eclipse installation that you have created above when prompted by the flex installer