Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Need help converting .txt(notepad) file to Excel (2000)

Hi,

Have data in a notepad/txt file in the following format:
Joe Smith
123 Main St
Anytown, AA 07340

Want this in Excel in the following format (5 columns 1 line).

First Last Address City State Zip

I've done this before, but don't recall the specifics with deliminated file
and such and can't figure out so will let you pros guide me.

Thanks
--
Paul
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,365
Default Need help converting .txt(notepad) file to Excel (2000)

My first recommendation is to look up the Excel Help topic
Split Text To Columns

That'll show how to do it with the split text to columns method. But I
think you're going to have a lot of work to do because of the arrangement of
the data.

Given some basic assumptions about your data, based on your example, we can
do it with formulas.
Basic Assumptions:
The data groups are 3 rows long, without any blank rows in between them.
Your names ONLY have a First and Last name (no middle initials)
The city name is always followed by a comma and a space
The State identifier is always 2 character abbreviation
The Zip code is always a 5-digit code

Begin by importing your text file into a single column (A) in a worksheet
beginning at row 1. So the first name is in cell A1 of the worksheet.

Set up labels in columns B through G for
First Last Street City State Zip

Remember that in the following formula examples, the editor here may split
it up, but they are always one continuous formula.

In cell B2 enter this formula [to get the first name]:
=LEFT(OFFSET($A$1,(ROW()-2)*3,0),FIND(" ",OFFSET($A$1,(ROW()-2)*3,0))-1)

In cell C2 enter this formula [to get the last name]:
=RIGHT(OFFSET($A$1,(ROW()-2)*3,0),LEN(OFFSET($A$1,(ROW()-2)*3,0))-FIND("
",OFFSET($A$1,(ROW()-2)*3,0)))

In cell D2 enter this formula [to get the street]:
=OFFSET($A$1,(ROW()-2)*3+1,0)

In cell E2 enter this formula [to get the city]:
=LEFT(OFFSET($A$1,(ROW()-2)*3+2,0),FIND(",",OFFSET($A$1,(ROW()-2)*3+2,0))-1)

In cell F2 enter this formula [to get the 2 character state abbreviation]:
=MID(OFFSET($A$1,(ROW()-2)*3+2,0),FIND(", ",OFFSET($A$1,(ROW()-2)*3+2,0))+2,2)

In cell G2 enter this formula [to get the 5-digit zip code]:
=RIGHT(OFFSET($A$1,(ROW()-2)*3+2,0),5)

After that, you can 'fill' the formulas down the sheet as far as needed to
pickup and convert all of the names/data in column A. See Excel Help topic
on:
fill formulas into adjacent cells

At this point you have a few of options:
#1 - you can leave things exactly as they are.
#2 - you can hide column A just to clean up the appearance of the sheet.
#3 - you can select ALL of the cells with the formulas in them (now showing
all of the data split up properly) and use Edit | Copy followed immediately
by using Edit | Paste Special with the [Values] option selected. That will
replace the formulas with the contents and you can then delete column A
entirely if you want to. But you might want to make a copy of the sheet
before doing that if you plan on having to do this all over in the future -
will save you having to type in all those formulas again.

Hope this helps at least a little.


"QuestionMan" wrote:

Hi,

Have data in a notepad/txt file in the following format:
Joe Smith
123 Main St
Anytown, AA 07340

Want this in Excel in the following format (5 columns 1 line).

First Last Address City State Zip

I've done this before, but don't recall the specifics with deliminated file
and such and can't figure out so will let you pros guide me.

Thanks
--
Paul

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting excel to notepad Cindy Excel Discussion (Misc queries) 3 July 6th 07 03:15 PM
Export notepad file to Excel Carrie Excel Discussion (Misc queries) 2 February 2nd 06 05:36 PM
Filter Notepad file into Excel Rudodoo Excel Worksheet Functions 1 December 1st 05 11:02 PM
copy excell file to a CSV file and than to Notepad need to know bob Excel Discussion (Misc queries) 0 August 23rd 05 07:27 PM
Excel 2000 worksheets save incorrectly as notepad files. Capdu Excel Discussion (Misc queries) 2 April 2nd 05 03:47 PM


All times are GMT +1. The time now is 12:05 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"