Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I have a text file that I want to o 1

Status
Not open for further replies.

SherWat

Technical User
Feb 12, 2016
216
CA
I have a text file that I want to open in excel called sample.txt.
When I open it in excel, I open it as delimited but some of the dates get messed up and I don't understand why?

Below is excel does:
FROM TO DATE TIME DURATION
2101 2102 2002/02/16 20:55:39 00:00:44
2101 2102 2002/02/16 22:49:45 00:00:14
2101 2102 2003/11/16 17:48:45 00:00:16
2101 2102 2003/11/16 18:35:55 00:00:18
2101 2102 04/29/16 22:16:52 00:00:22
2101 2102 04/29/16 22:26:49 00:00:22
2101 2102 05/17/16 21:15:30 00:00:50
2101 2102 2006/01/16 12:06:31 00:00:30
2101 2102 2007/04/16 05:21:27 00:00:14
2101 2102 2007/04/16 08:58:29 00:00:10
2101 2102 2010/07/16 19:24:45 00:00:08
2101 2102 2010/07/16 20:33:14 00:00:08
2101 2102 2010/07/16 22:49:34 00:00:38
2101 2102 2010/07/16 22:50:16 00:00:16
2101 2102 2010/08/16 04:26:17 00:00:38
2101 2102 10/28/16 12:59:06 00:02:06
2101 2102 06/26/16 03:46:41 00:00:08
2101 2102 06/26/16 05:35:54 00:00:38
2101 2102 2009/06/16 11:55:11 00:00:22
2101 2102 11/13/16 12:27:32 00:00:20
2101 2102 11/13/16 17:34:48 00:00:18
2101 2102 2002/11/16 04:27:56 00:00:06
2101 2102 2004/03/16 05:49:36 00:00:24

Thanks.
 
 http://files.engineering.com/getfile.aspx?folder=b9373195-3846-4501-9c4d-c986d0c119b7&file=sample.txt
Hi,

What never? No never! What never? Hardly ever!

...open a text file with Excel, simply because of exactly what you are experiencing. See
FAQ68-7375
FAQ68-5827

Rather I most often IMPORT text files via Data > Get external data > From text...

In this approach, you can specifically define the type of data you have for each column of data. Date fields conversion can be specified in several formats.

Also, if you have columns that you do not want converted, you can IMPORT those columns as TEXT.



Skip,

[glasses]Just traded in my OLD subtlety...
for a NUance![tongue]
 
YEAH! You're awesome! That worked! Thank you so much. I will remember to do that in the future.
Have a star!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top