Jump to content

This topic is 2561 days old. Please don't post here. Open a new topic instead.

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

Link to comment
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

Link to comment
Share on other sites

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
Link to comment
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.

Link to comment
Share on other sites

This topic is 2561 days old. Please don't post here. Open a new topic instead.

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
×
×
  • Create New...

Important Information

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