Why does formating get messed up during import from text to csv?

Steve Swift

Board Regular
Joined
Jan 18, 2004
Messages
187
Hi Everyone,

I'm tryng to convert a text file that is comma separated into a csv. I've done this hundreds of times in the past but one thing really puzzles me and I'd appreciate any guidance on how I can fix this.

In the text file I have some bank details whic show sort code and bank account number. These are separted in teh text file correctly with commas as in teh example below.

,11-11-11,01234567,

When I open the text file using excel and import it. I select the format of Text for all columns and excel displays the data. Now to my problem, in the column where the sort code is contained "AH" (in the example above that is 11-11-11) Some of the cells show these as a date format such as 11/06/1941 while other cells show this information correctly formated as 11-11-11. I can see no logical reason why for example these cells format incorrectly

AH2
AH3
AH10
AH28
AH30

Those are just a few examples to show the apparent randomness of the issue. The text file itself looks 100% error free.


It's as if Excel ignores the format command on some cells during the import. Can anyone help me with this problem?

I'm using Excel 2007

Thanks

Steve
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Hi Steve,
To make it simple, why don't you just change the extension from .csv to .txt? This way, you have the option to change the format to "text" instead of the excel "smart" format selection
 
Upvote 0

Forum statistics

Threads
1,214,968
Messages
6,122,509
Members
449,089
Latest member
RandomExceller01

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top