SOLVED

Import CSV change

Copper Contributor

 

Annoying new problem, with a recent Excel "update"...

 

I have a standardized CSV file format that used to load into excel fine.

The file is ";" separated and commences with a few lines of header data, 2 columns and then multiple lines of data 10+ columns of main data.

Previously Excel used to look at file and set up the import to bring data in for the 10+ columns.

Now it seems to look at the first line and then set all import to that.

 

Header1; text1 

Header2; text2

Header3; text3

Data1; Data2; Data3; Data4; Data5; Data6; Data7; Data8; Data9; Data10

Data1; Data2; Data3; Data4; Data5; Data6; Data7; Data8; Data9; Data10

Data1; Data2; Data3; Data4; Data5; Data6; Data7; Data8; Data9; Data10

Data1; Data2; Data3; Data4; Data5; Data6; Data7; Data8; Data9; Data10

Data1; Data2; Data3; Data4; Data5; Data6; Data7; Data8; Data9; Data10

Data1; Data2; Data3; Data4; Data5; Data6; Data7; Data8; Data9; Data10

 

How do I use the previous default and load this all? or 

Select which line sets the number of columns

 

ATM I have to edit the CSV and either drop a dummy copy of a dataline into the first line or 

Delete my header data.

Neither is what I want to do.....

 

Thoughts?

 

8 Replies

@Chris_Shackleton , you can use the "From Text/CSV" option from the Get & Transform section in the Data tab:

TheAntony_0-1596384360231.png

 

Then, in the dialog that pops up, select the "Transform Data" Button:

TheAntony_1-1596384427587.png

 

This will take you to the Power Query Editor and you can do a lot of transformations from here. In this case you can remove the top 3 rows and perform further data shaping you require:

TheAntony_2-1596384557138.png

 

Once you are done with your transformations, click on Home->Close and Load To:

TheAntony_3-1596384621119.png

 

You can load to your desired location:

TheAntony_4-1596384666878.png

 

 

@TheAntony 

Hi thanks for the response.

Hadn't used that option before.

 

While it does allow me to deselect the top rows when I "delete" them 

the import is still limited to the 2 columns.

 

Am I missing a stage?

@Chris_Shackleton , Power Query is incredibly powerful and can pretty much do everything you can throw at it. I was able to import everything based on a made up txt file I created from your original post. If you can share a sample of your file (removing any confidential data), I can provide more assistance.

best response confirmed by Chris_Shackleton (Copper Contributor)
Solution

@Chris_Shackleton 

In general you may allow legacy text import wizard in options

image.png

which was the only option in previous Excel versions, and use it. But both this wizard and Power Query give exactly the same result, they recognize all data columns. Perhaps it's something else with your file, better if you submit it as txt file, not as the part of the text within the post, which is actually HTML.

Must be something strange about the file
See attached.

@Chris_Shackleton 

 

Sorry forgot to add data

@Chris_Shackleton 

Both Power Query

image.png

and legacy wizard

image.png

 

import data from this file correctly.

@Sergei Baklan 

 

Thanks for the quick response.

OK so when I load the file I sent (just edited to remove sensitive data) it also works for me.

Seems like the original just needs to be opened in a text editor and re-saved.

 

Solved thanks m8

1 best response

Accepted Solutions
best response confirmed by Chris_Shackleton (Copper Contributor)
Solution

@Chris_Shackleton 

In general you may allow legacy text import wizard in options

image.png

which was the only option in previous Excel versions, and use it. But both this wizard and Power Query give exactly the same result, they recognize all data columns. Perhaps it's something else with your file, better if you submit it as txt file, not as the part of the text within the post, which is actually HTML.

View solution in original post