March 24, 20178 yr 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
March 24, 20178 yr 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.
March 24, 20178 yr Author 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
March 24, 20178 yr 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 March 24, 20178 yr by comment
March 24, 20178 yr Author 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.
Create an account or sign in to comment