Register to reply

Transforming a text file to a database

by adjacent
Tags: database, file, text, transforming
Share this thread:
adjacent
#1
Aug10-14, 08:00 AM
PF Gold
adjacent's Avatar
P: 1,516
I have a list of contacts like this:
Name ,Address:House ,Island ,Atoll 	7777777
Name ,Address:House ,Island ,Atoll 	7777777
Name ,Address:House ,Island ,Atoll 	7777777
I have a large number of these and I want the details to be separated to different columns. Is there any program which will do this for me?

I tried searching google and got nothing.
Phys.Org News Partner Science news on Phys.org
'Office life' of bacteria may be their weak spot
Lunar explorers will walk at higher speeds than thought
Philips introduces BlueTouch, PulseRelief control for pain relief
jtbell
#2
Aug10-14, 08:55 AM
Mentor
jtbell's Avatar
P: 11,872
Microsoft Excel's "import wizard" (which you get automatically when you open a text file in Excel) can be used to remove the commas and the colon, and open the file as a spreadsheet. Then you can save it as a tab-delimited text file if that's more suitable for you than an Excel spreadsheet.

The Open Office clone of Excel might have a similar import wizard.
TurtleMeister
#3
Aug10-14, 10:14 AM
TurtleMeister's Avatar
P: 759
Yes, you can do it with Open Office. Open a new spreadsheet and on the main menu click "Insert". Then click "Sheet From File". A dialog box will appear where you can select what delimiters you want to use.

Borg
#4
Aug10-14, 10:28 AM
PF Gold
Borg's Avatar
P: 784
Transforming a text file to a database

Quote Quote by adjacent View Post
I have a list of contacts like this:
Name ,Address:House ,Island ,Atoll 	7777777
Name ,Address:House ,Island ,Atoll 	7777777
Name ,Address:House ,Island ,Atoll 	7777777
I have a large number of these and I want the details to be separated to different columns. Is there any program which will do this for me?

I tried searching google and got nothing.
If you include the word 'parse' in your search, you will get lots of hits - how to parse a text file.
But, as posted, Excel is quick and easy.
adjacent
#5
Aug10-14, 11:39 AM
PF Gold
adjacent's Avatar
P: 1,516
Oh, I didn't know Excel was that great . I think I should learn MS office products more.

Thanks guys.
jtbell
#6
Aug10-14, 11:53 AM
Mentor
jtbell's Avatar
P: 11,872
I was able to open and fix up your small sample (after copy-and-pasting it into a text file) as I described it, using Excel for Mac 2011. The details may differ for you depending on which version you have, but it took me only a couple of minutes to figure it out in the "wizard."
adjacent
#7
Aug10-14, 02:11 PM
PF Gold
adjacent's Avatar
P: 1,516
Quote Quote by jtbell View Post
I was able to open and fix up your small sample (after copy-and-pasting it into a text file) as I described it, using Excel for Mac 2011. The details may differ for you depending on which version you have, but it took me only a couple of minutes to figure it out in the "wizard."
Yeah, I got it done too.I opened the text file in excel and the wizard opened


Register to reply

Related Discussions
How to transfer text file from PC to TI nspire CAS Calculators 7
Getting fortran to read a text file and write the whole file to a different location Programming & Computer Science 4
Text File Editing Programming & Computer Science 14
Locating end of text file Engineering, Comp Sci, & Technology Homework 4
How can Capture Text form image file and save it as txt file or word file Computers 2