Jump to content

Recommended Posts

Hey,

I have a Tab-Separated Text File which I want to import to a database that I just created in FileMaker Pro 15. The text file essentially is a log of events, for instance, one line describes an order, another line describes a payment that has been made. The problem is that I somehow need to import all these lines into different tables. I want all lines in the log file that describe a payment in a table called Payments, and all lines that describe an order in a table called Orders for example.

I'm just starting out with FileMaker so forgive me if there is an obvious solution that I'm not aware of. I have a background in software development, so the only solution that I can think of is writing a small program myself that does all the parsing for me and creates separate text files that contain all the orders and payments and other events that have been logged in the file. Then I could simply import each file into the table I need all the data in. 

So to sum everything up, my main question is if there is a way to somehow parse the text file before importing it. I know that you can create custom scripts in FileMaker but I'm not sure if what I need to do can be done just with that.

Thanks in advance,

Mike

Share this post


Link to post
Share on other sites
3 hours ago, 123 said:

one line describes an order, another line describes a payment

You left out the part explaining how to tell these two apart.

Share this post


Link to post
Share on other sites

Hey,

each line has a certain keyword. For example Payment or Order. Those keywords are in the same position in every line.

Thanks for your response,

Mike

Share this post


Link to post
Share on other sites
Posted (edited)

Basically, you have two options:

1. Import the file twice, once into the Payments table and once into Orders. In each table, define a Type field and set it to validate by calculation:

 Self = "Payment" 

and:

Self = "Order"

respectively, validate always. When importing, map the keyword to the Type field.

 

2. Import into a temp table first, then do a find for each type and import the found set into the corresponding target table.

 

Both options can be scripted so that the user only needs to select the file.

Edited by comment
  • Like 1

Share this post


Link to post
Share on other sites

Hey,

thanks for the quick response. The first way you described sounds like a good solution, I will give it a try tomorrow, thank you so much.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Similar Content

    • By rainforestjim
      I'm using some script to direct users to different layouts when the access my database via WebDirect. At the moment all users are directed to one of two layouts using the following 
      #t ( Case ( APP__Application::Type = "Long" ; "Application Detail WEB" ; "Application Detail Rapid WEB" ) )
      What I actually need to happen is that when a "reviewer" logs in they are directed to "Application Detail Review WEB" for everyone else the above code is correct.
      Any help would be much appreciated.
    • By -dp-
      I’m trying to create an interface that will find all entries in the month specified in the script parameter. If the user selects the Sep button, I want the script to query a date field for “2017-09-01…2017-09-30”. This works correctly when I do it manually, and a case statement correctly builds this string in the variable $_range. But when I try to script the query as follows:
      Enter Find Mode [Pause: Off]
      Set Field [Calendar::calDate; $_range]
      Perform Find [ ]
      it consistently throws a 500 error, even though I’ve set no validation restrictions.
      Set Field [Calendar::calDate; “\” & $_range & \””] does not resolve the problem.
      Can anyone troubleshoot this, or suggest an entirely better method?
      Thanks,
      dp
    • By KassK
      Hi
      I have been asked to set up something that will send out email automaticly when the date in the "review date" field is 14 days prior to the current date, can someone help me with a script that would be able to perfom this task? I have also created and email field that will hold the email address.
      thank you
      Kassy
    • By hutchlad
      Hi Guys, Just a quick question for a beginner, I have created multiple export scripts, and notice that when I create a master script with the numerous subscripts being called, sometimes the output isnt correct, whereas when I run each script one by one (rather than lots of subscripts within a master script) the final result is fine. Could there be anything wrong with using subscripts for this?
      Should I always have an Exit Script step at the end of each subscript? I hope that makes sense
      Thankyou
    • By 123
      Hey,
      I have a question about hosting my filemaker database. If I buy a license for 5 people form here: https://store.filemaker.com/filemaker-cloud , will I also need to purchase 5 normal FileMaker 16 Pro Client licenses so people can actually connect to the database? I don't quite understand how this works yet, maybe someone can help me out. Do I get the client licenses with the purchase of a server license? I need 5 people to be able to access it. Thanks in advance,
      Mike
×

Important Information

By using this site, you agree to our Terms of Use.