Question

How to parse information from a text file into separate records in File Maker 5.5?

Asked by: kokojie

This is what I am trying to do:

I have a file that contains countries, companys and email addresses, I have this file in .doc(MS Word) and .txt format.
I want to parse these information into separate records in a new database.

This is what the text file look like:
<--------------------------------------Text File----------------------------------------->
ALBANIA 4
TOP CHANNEL
1 Mr JAHO Alban, Deputy Director General alban.jaho@top-channel.tv
2 Mr SEJAMINI Neritan, Marketing Director nsejamini@albvizion.com
3 Ms AJAZI Brunilda, Acquisition Manager bajazi@albvizion.com
4 Ms DAKO Vjollca, Assistant General Director vjollca@top-channel.tv

ALGERIA 3
ENTV (TELEVISION ALGERIENNE)
1 Mr HAMRAOUI Habib Chawki, Directeur GŽnŽral
2 Mr BENRABAH Djamel, Directeur des Programmes djamel_benrabah@yahoo.fr
3 Mr KHALLOUF Omar, Department Achats de Programmes

ARGENTINA 16
AMERICA VIDEO FILMS S.A.
1 Mr MAYA Enrique, President america@americavideofilms.com
ARTEAR S.A.
2 Mr SEQUEIRA Walter, Acquisition Manager walter_sequeira@artear.com.ar
3 Mr RODRIGUEZ MONTERO Julian, Acquisition Executive julian_montero@artear.com.ar
AVC TELEVISION SA
1 Mr CIRUZZI Alejandro, CEO y Presidente alexciruzzi@avctelevision.tv
CENTRAL PARK PRODUCTIONS
1 Mr LECOUNA Raul, President rlecouna@centralparkprod.com.ar
4 Mr TOBI Ariel, Buyer arieltobi@telefonica.net
LEDAFILMS S.A.
1 Mr LEDA Pedro Felix, President pedro-leda@ledafilms.com
4 Mrs LISANTI Viviana, Head of Acquisitions vlisanti@ledafilms.com
PROMOFILM SA
2 Mrs CAMPOS Marcela, Head of Contents
4 Mr CONTRERAS Jorge, Head of Programming
5 Mrs DOMINGUEZ Adriana, Acquisitions Executive
RGB ENTERTAINMENT
1 Mr YANKELEVICH Tomas, Development Manager tyankelevich@rgpcorp.com
TELEFE INTERNATIONAL
1 Mrs DAUJOTAS Patricia, Acquisitions Manager pdaujotas@telefe.com.ar
8 Mr VILLARRUEL Claudio, Artistic Director cvillarruel@telefe.com.ar
TELEFILMS S.A.
1 Mr DARCYL Sebastian, President sdarcyl@telefilms.com.ar
2 Mr DARCYL Tomas, tdarcyl@telefilms.com.ar
<--------------------------------End of Text File-------------------------------------->


Basically it goes on like this with the rest of the countries, and have 80 pages total.


I want to make a database that parse all these information into separate records based on
Company Name, and contains the following fields:

Company Name  (Each records should be about each individual Company)
Country  (Which country is this company located)
Email  (The first email address that appears under each company)
Contacts  (All the contact person's names and email addresses for this company, including the first one)



If you need any clarifications, please ask me, If you can solve part of my problem, please do,
Thank You for reading this question!!!

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2004-02-08 at 13:20:40ID20877524
Tags

text

,

file

,

parse

Topic

FileMaker Pro Database

Participating Experts
3
Points
500
Comments
14

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. what is the best way to market this new marketing technolo…
    i have a new ad technology utilizing adware. targets by keyword or url and delivers rich media ads non-intrusively by creating "previously unavailable real estate" within the browser. Is not spyware; does not display popups; based on permission based downloads. (T...
  2. J2ME Market Penetration
    What is the J2ME market penetration these days on mobile phones? Are people actually using mobile java apps and services? How's the market in North America, UK, and Japan? Is there a website offering up this information? Thanks.

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: lesouefPosted on 2004-02-09 at 00:26:36ID: 10308196

First, you should not show these emails, they gonna receive loads of spams!
1st question: is the file formatted with style sheets which would allow a proper XML export, or is it 'flat'?
If no hope on XML side, then you need to an external process to re-arrange the file as a proper tabbed file. Do you have some programming skill? Doing 80 pages manually will take some time!
You could also import as is, and do a bit of scripting to re-write the file using filemaker, but I need 2 or 3 hours to think about this, which I can't do now. I'll see tonight if I can spare some time

 

by: lesouefPosted on 2004-02-09 at 10:50:14ID: 10313017

I need to know the max amount of people per company. Fm has a limit for multivalued fields, so you may need to create a person based table instead of company based, or create 2 tables linked together by the company name.
On top, depending on what you need to do afterwards with this base, you have to know that multivalue fields are heavy to handle: for instance the value order cannot be a variable in a script, which limits automatic actions on them.
So far, I've done an example of a table based on persons which you can see there:
http://extranet.valblor.com/~lesouef/import.fp5
It is based on the list I pasted in notepad: http://extranet.valblor.com/~lesouef/import.txt
Use it in search mode, you'll see that even based on persons instead of companies, the FM pop list makes it easy to use (depends how many companies you end up with).
If it is too heavy, I'll work on a 2 tables solution.

 

by: kokojiePosted on 2004-02-09 at 16:11:10ID: 10316833

Hi Lesouef, Thanks for your help.  I'll clarify a few things to make it easier,

Records based on company name is pretty much a requirement, I'm really sorry
I can not do it based on person.

I quickly read thru the file, there are probably no more than 20 person / company,
so I guess we can assume 20 will be the max.  

If some kind of additional formating is required, I would be happy to do it,
as long as it doesn't involve manually enter 80+ page of data into filemaker  :))

I would like all the fields to be text fields, if possible.  Like all the person+email
in a text box.  I mean put everything into simple text boxes if possible.
The database should look something like this:
http://www.songfeng.com/downloads/sampledb.jpg


Thanks for helping me out!!

 

by: lesouefPosted on 2004-02-09 at 23:59:39ID: 10320120

OK, you don't want to split personal_info, easy, I just have to remove some cleaning scripts.
For the list of persons, do you want a multivalueed field or a simple list in a text field? (yr screen capture looks like this).
I won't work on it before tonight at the very best...

 

by: kokojiePosted on 2004-02-10 at 07:47:37ID: 10323139

Hi, Lesouef.  Yeah, I only want the contacts in simple text field,
actually just about everything should be in simple text field :)
they don't have to be a multivalueed field.  

Thanks!

 

by: lesouefPosted on 2004-02-10 at 09:26:42ID: 10324017

That should be it. Reload the same:
http://extranet.valblor.com/~lesouef/import.fp5
Make sure you check tabbed file type at start of the import script when selecting file to import; there is a FM bug, it does not save properly file type in scripts if you do not save the name to be imported, and defaults to "all types" and makes a selection "contextwise": in your case, it will use CSV because there are commas in yr file! and my script collapses!
Otherwise, that should be OK, at least it works OK on yr sample file.

 

by: kokojiePosted on 2004-02-10 at 11:08:46ID: 10325039

OHH! thanks, I can't wait to try it.  I'll try it tonight when I get home.  :)

 

by: lesouefPosted on 2004-02-10 at 11:28:32ID: 10325259

I'll see that too-morrow then! (I live on GMT+1)

 

by: kokojiePosted on 2004-02-10 at 17:33:20ID: 10328441

Hi, Lesouef.  Your script worked really well, I'm really happy! :)
But, there is one more thing I wanted to ask you.

Asssuming we have: A Database(the one we created) and B Database(my other existing database)
How do I write a script to import records from A database into B Database and it should check if
company name already exists in B Database.   If company name already exists do not import.  
Otherwise import.  Thanks!

 

by: lesouefPosted on 2004-02-11 at 00:01:26ID: 10330199

First create a link from A to B using the company name
then in A create a new field called for instance
AlreadyExist = if (linkB::companyname=companyname;"yes";"no")
Still in A, search all records where AlreadyExist="no"
Go to B, import records from A
A good thing to remember, when you import from another FM base, it takes the found set, searching manually what you want to import in the source file is enough to import records selectively; on the other hand, do not forget to search all records in the source file before importing if you'd likle to import everything.

 

by: kokojiePosted on 2004-02-11 at 16:10:41ID: 10337715

wow, cool, thanks! it worked very well, I really appreciate all your help,
Thanks again!

 

by: UnicornTapestryPosted on 2004-02-26 at 12:35:01ID: 10463583

I just finished a project with similiarities- parsing raw data and making sense of it in a database. My solution was to use THREE FileMaker files:
bParser- batch process into individual records
aParser- process record into recognizable fields
Final- the final database

Analysis
--------
1. You know that individual subrecords (like your list of names) would be less than 20.
2. I had a number of delimiters to deal with, but you have just NLs (paragraph markers), blanks, and a comma.
3. Your records appear to be separated by double paragraph markers.
4. You know that your names list starts with a number, then a blank, then a name, a comma, and finally a mailto URL.

The key to the solution is using calculated fields to scan for delimiters and plug field values where they are expected.

bParser
-------
1. Be sure your raw data ends with two paragraph markers.
2. Create a handful of essential fields:
- RawData: The gluttonous field that will contain your raw text.
- aRecord: Text field to hold one record at a time.
- RecCount: A numeric calculation field with this formula will tell you how many records must be processed:
PatternCount(RawData, "¶¶")
- i: Numeric loop counter.
- p: a numeric field that will serve as a lexical scan pointer, moving from delimiter to delimiter. It's initially set to 1.
- q: another numeric pointer field which will point to the delimiter AFTER the one pointed to by p.
In operation, p and q will bookend one complete record at a time.
3. Create a Batch Process script that loops through RawData, breaking out individual records. Roughly the script algorithm is:
LOOP
   SET FIELD ["q", "Position(RawData,"¶¶",p+2,1"]
   SET FIELD ["aRecord", "MIDDLE(RawData,p,q-p"]
   COPY [Select,"aRecord"]
   PERFORM SCRIPT [Subscripts,External: "aParser.fm5"]
   SET FIELD ["p", "q+2"]
   SET FIELD ["i", "i+1"]
   EXIT LOOP IF ["i > RecCount"]
END LOOP
p and q point to the double paragraph delimiters surrounding an individual record and suck it into aRecord. The loop then calls a script in aParser.

aParser
-------
The important things to remember about aParser is that (a) it never contains more than one record at a time and (b) all its intelligence is located in calculated fields.
1. Create a number of fields, mostly delimiter pointers, fields for the breakout of names and mailto URLs, and a field that contains the raw record data:
a. aRecord: the text delivered up from bParser.
b Individual line calculated fields with a formula similar to the following that pops out the 14th name/URL info:
user14: Middle(aRecord,Position(aRecord,"¶",2, 14 )+1,Position(aRecord,"      ",2, 14 )-Position(aRecord,"¶",2, 14 )-1)
2. Within those 20 fields, you can snatch out more specific fields using the comma as one delimiter. With the LEFTWORDS, MIDDLEWORDS, RIGHTWORDS functions, you can populate your name, number and mailto URLs. Be just a little careful when using RIGHTWORDS to pick up the URL- It breaks on more than just white space, so you may find that you have to pick up 2 or even 3 of the rightmost words to construct the URL.
3. Done correctly, you'll have one intact record, albeit with uneditable calculated fields. You also have raw data and work fields (like aRecord and user01-user20) that you don't want anymore.
4. The script couldn't be simpler. Remember, it's triggered by the loop from bParser:
   DELETE ALL RECORDS [No Dialog]
   NEW RECORD
   PASTE [Select, No Style,"aRecord"]
   PERFORM SCRIPT [Subscripts,External: "Final.fm5"]

Final
-----
1. Define your required fields and do one experimental import to get your fields aligned with the Final database and you're ready for the script.
2.  It's script is simple too:
   IMPORT RECORDS [Restore, No Dialog, "aParser.fm5"]
That's it.

Summary
-------
   The reason I used 3 FM databases instead of two was that I didn't want unnecessary calc fields hanging around, and I used bParser for crude processing and then aParser for parsing with more detail and finesse.
   The technique has proved remarkable robust. I recently used the same technique to process a batch of raw URLs into a database were keywords and their values (&userid=BARNEY) could be picked apart and stored.

 

 

by: eyeandyPosted on 2004-05-30 at 01:46:35ID: 11190019

lesouef,
you say FM has a limitation to multivalued fields?  what limitation is there?

 

by: lesouefPosted on 2004-05-30 at 06:32:24ID: 11190777

1000 subfields.

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...