MySQL has a nice CSV import function LOAD DATA INFILE
.
I have a large dataset that needs to be imported from CSV on a regular basis, so this feature is
I assuming the you need information only through mysql no by any programming language. Before use load data covert the format to windows format \r\n ( CR LF ) if u have notepad++. And then process the Load data query. Make sure the LINES TERMINATED BY '\r\n'
Edit:
Since the editors are often unsuitable for converting larger files. For larger files the following command is often used both windows and linux
1) To convert into windows format in windows
TYPE [unix_file] | FIND "" /V > dos_file
2) To convert into windows format in linux
unix2dos [file]
The other commands also available
A windows format file can be converted to Unix format by simply removing all ASCII CR \r characters by tr -d '\r' < inputfile > outputfile
grep -PL $'\r\n' myfile.txt # show UNIX format style file (LF terminated)
grep -Pl $'\r\n' myfile.txt # show WINDOS format style file (CRLF terminated)
In linux/unix the file command detects the type of End-Of-Line (EOL) used. So the file type can be checked using this command