Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Import to SQL when the row has to be a column

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-07-26 : 08:49:35
Mano writes "have a small problem!
I have recieved a txt file with some 1000 addresses in the following format:

File As: Mano Nomo
First Name: Mano
Middle Name: John
Last Name: Nomo
Home Address Street: blah blah
Home Address City: blah
Home Address Country: Usa
Work Tel: (333) 9751442
Work Fax: (333) 2412562
Mobile tel: (999)2356489
email: harleyd@ausi.com
Birthday: None
Anniversary: None
Pager: (333) 9812601

and the next adress is after this one in the same format! and so one until 1000 of them.

The Question is: How can i import this to SQL ???
So that the table looks like:
File As | First Name | Middle Name | Last Name |
Mano Nomo Mano john Nomo

Is there any way how i can do this, am still new with SQL

Thank you !!!"

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2002-07-26 : 09:06:12
The first thing you should do is try to get your provider to give you a more workable format.

Get ready for a real struggle.
You can probably create a format file that specifies a line feed as the column delimiter and line feed + "File As:" as the row delimiter...you'll have to play with it. Then you can pump this all into a staging table and write some queries to get rid of the 'First Name:','Last Name:'....text...

<O>
Go to Top of Page
   

- Advertisement -