Importing CSV file

[expired user #7300]'s profile image [expired user #7300] posted 11 years ago in Feature discussion Permalink
Just made a donation for this great piece of software which I am using on a daily bases. Keep up the good work!

I have one update I realy like to see in a future release. I use the CSV import weekly for multiple databases. It works fine but when I could save import profiles (selected columns and order of the columns) it would be perfect. Now I have to change them all again and again with every import and that takes a lot of time.

Is this difficult to build in?
ansgar's profile image ansgar posted 11 years ago Permalink
HeidiSQL preserves most of the settings for the next time you call that dialog, except for the field names and their order of a table.

For such a reoccurring query I recommend storing the LOAD DATA query in a snippet file: Just copy the LOAD command from the log window, paste it in a query tab, and store it as a snippet (right click > Save as snippet). That way, you have individual "profiles" for each table/file on which you want to do that.
[expired user #7300]'s profile image [expired user #7300] posted 11 years ago Permalink
Hi Ansgar, thanks for responding smile

I know HeidiSql saves most of the paramaters for the next import but I have different CSV files for different databases so I have to select a new file and database table everytime I use it.

Customers deliver CSV files seldom in a consequent layout so I allways have to make some adjustments in the columns selected and the order of them to fit both the CSV file and the database table.

Considering this, saving the query as a snippet is not doing the job in allmost all cases. It would be handy to save the column and order layout in a profile so it can be loaded and adjusted where needed instead of doing it all over again.
ansgar's profile image ansgar posted 11 years ago Permalink
Well, you can easily do that with a snippet file, or?
[expired user #7300]'s profile image [expired user #7300] posted 11 years ago Permalink
I often get a incomplete CSV file with, let's say, 4 columns to import in a table with 26 columns. In that case in HeidiSql I have to deselect 22 columns one at a time and reorder the selected ones according to the csv file.

Seems not a lot of work but when you have to do it often it is. And also more prone to error.

Saving the selected columns in a profile per job / table would be perfect as a starting point (their are allways changes) but a select / deselect all columns button on the importscreen would help a lot too. I know my question looks picky but I have to deal with all kinds of messy csv files.

Again, the CSV files are often not consequently ordered, so saving the load data query is not possible in most cases.
ansgar's profile image ansgar posted 11 years ago Permalink
I must say I still recommend snippets, as these give you the maximum flexibility and portability. You could nicely format the SQL in it, so you're very quick when adding new columns or changing the order.
[expired user #7300]'s profile image [expired user #7300] posted 11 years ago Permalink
I will, but please consider a select all / deselect all on the columns in a future upgrade, would make my life a lot easier ;-)

Thanks for the discussion and fast responses!
ansgar's profile image ansgar posted 11 years ago Permalink
Oh yes, select/deselect all is a good idea. Wasn't there such buttons in the past? (scratch head)
[expired user #7300]'s profile image [expired user #7300] posted 11 years ago Permalink
Not in my era ;-)
[expired user #7300]'s profile image [expired user #7300] posted 9 years ago Permalink
Hi Ansgar, did you have a chance to incorporate this simple solution?
[expired user #7300]'s profile image [expired user #7300] posted 9 years ago Permalink

Hi Ansgar, did you have a chance to incorporate this simple solution?



Update: In 8.3.0.4857 I cannot import .csv files from my network shares anymore. Network shares are not available when I want to pick the .csv file to import... This was working before.
[expired user #7300]'s profile image [expired user #7300] posted 9 years ago Permalink
Update: Forget my last remark concerning the network shares, installing the 64 bit version seems to solve it.

But I still like the select all/none optionon the columns importing .csv files... ;-)
Code modification/commit from ansgar.becker, 9 years ago, revision 8.3.0.4858
Add "check/uncheck all" button to column selector in textfile import dialog. See http://www.heidisql.com/forum.php?t=13566
ansgar's profile image ansgar posted 9 years ago Permalink
Done in r4858
[expired user #7300]'s profile image [expired user #7300] posted 9 years ago Permalink
Thank you! smilehappy

Please login to leave a reply, or register at first.