10-12-2017 12:31 AM
10-12-2017 12:31 AM
I've got an issue when I am importing a text file and using the text to columns function where its not recoginsing the correct date format in one of the columns. The text file is generated from a system that is based in North America so the date follows the mm/dd/yyyy format. As I am in the UK I need it to be dd/mm/yyyy. For some reason it is able to convert to the correct format for those dates where the day is less than or equal to 12 but when it goes over that it doesnt know what to do with it and just leaves it as text. If one of my collegues in North America carries out the same process it converts them all ok, I'm thinking its a regonal thing but not sure where to start checking. I've attached 2 files, one is the raw txt file, the other is after I import it to Excel. Does anyone have a suggestion as to what the issue might be?
10-12-2017 01:33 AM
On third step of the wuzard select correct date format for that column (US one in your case)
10-12-2017 01:42 AM
Hi Sergei - I've tried this method also but it still ends up with the same results. It converst the ones with days less than or equal to 12 and ignores the rest !! Very frustrating.
10-12-2017 02:05 AM - edited 10-12-2017 02:06 AMSolution
Craig, it looks like due to time added to that field. If time is not important for you (i.e. it always 0:00:00) you may open csv file and Text to Columns last column with space separator, remove time only column after that.
See result attached. If the time is important will find somethin else.
10-13-2017 01:48 AM
Well it didnt work exactly the way that you thought it would but I've managed to find a solution. Unfortunatley I havent been able to find the route cause of the problem so will have to carry out this work around every time I need to carry out the same action. Thanks for your help Sergei.
10-13-2017 06:49 AM - edited 10-13-2017 06:49 AM
Craig, you may use Power Query (Get&Transform in 2016). It picks you txt file up and transforms correctly if for this column you use Change type->Using locale transformation.
You need to adjust the query only once, perhaps add name of txt file as parameter. After that no additional operations.
Attached is how it looks like, "Import File.txt" for this sample is in the root of C:\