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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Importing .txt into MS Excel

Status
Not open for further replies.

Unrivaled1

IS-IT--Management
Feb 9, 2005
20
US
Is there a way to import an msdos .txt file so that each line of text gets imported into a separate column within the same row?

For example: A .txt file with 20 lines of text all separated by carriage returns.. Imported into a single row within a spreadsheet, one line per column.
Any help would be greatly appreciated.


 

Unrivaled1,

Think about it. You'd ONLY be able to import 256 lines!!!

Import your text file, withour delimiting.

Copy the data

Assuming that you have LESS THAN 256 rows, Paste Special - Transpose.

Skip,
[sub]
[glasses] [red]Be advised:[/red]We know Newton's 3 Laws. But did you hear about the [red]FOURTH???[/red]
Only ONE fig per cookie![tongue][/sub]
 
The simplest way would be to edit the ".txt" file so that the 20 lines becomes 1 line, each seperated by a space, then open it into Excel & select the space (or comma) delimited option.

[cheers] & all the best.
 
See if the following gives you the desired results...

Open File (Ctrl+O)
Change Files of Type to Text Files
Browse to the file you want to import
Click Open
Click Finish
Select all the imported cells (Do not use Column Select)
Copy to clipboard (Ctrl+C)
Select Cell B1
Edit > Paste Special
Select the checkbox for Transpose
Click OK
Delete Column A
 
Skip.. Do you mean assuming I have less than 256 columns??

As I stated in my original post, 20 lines per .txt file. That equates to 20 columns per row. I'm pretty sure the amount of rows I can have are nigh endless.


CorBlimey.. That would be the simplest way to go, and one I may yet have to resort to, but I have 700+ such text files I need to import into a single spreadsheet. I'm trying to not have to manually edit them all in any way.
 
Thanks dcompto! That did in fact work nicely. I need to see if I can mass-produce that effect for all of these text files, but if nothing else I now know it can be done.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top