Jump to content

Recommended Posts

123    1

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
comment    1,382
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
123    1

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
comment    1,382
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
123    1

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  

  • Who Viewed the Topic

    1 member has viewed this topic:
    JerrySalem 
  • Similar Content

    • 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
    • By hutchlad
      Hey Guys,
      Thanks for having me I'm a beginner please take it easy haha!
      Basically I have a calculation field, where I am trying to force the answer as "0" when the calc returns "?" (due to an empty field etc, for whatever reason I'm not concerned about)
      My calc is:
      Round ( If ( IsEmpty ( Cash Sales Total Sales Value )=1 ; 0; (Cash Sales Total Last 7 Days-(Landed Cost*Cash Sales Total Last 7 Days)*1.2) / Cash Sales Total Sales Value ); 2) Now it returns an answer when there is one, or a "?" when insufficient data, all I want is to return a "0" in this case rather than a "?"
       
      Thanks in advance and sorry for the noob question
    • By Jeff M
      Hello,
      I've done quite a bit with FileMaker in the past, but have never jumped into the XML arena. Now I have a need to do so, and I'm really needing some help with something I'm sure is quite basic...but still foreign to me. I have an external data source which export XML in a very specific format (see attached). I need to import that into FileMaker so I can manipulate the data, do some various lookups, etc. Once I've made my changes in the data, I need to export in the exact format it was when imported so the external data source can properly import.
      Not sure if it makes sense to import into 2 tables (workflows, workflow steps) or just a single table. I'm open either way. Once the data is in FileMaker I can get all my calculations and lookups and scripts going and make the data what I need it to be, but then I'll need to export it.
      Can someone point me in the right direction?
      Thanks so much in advance!
      Jeff
      workflows_export.xml
    • By 123
      Hey,
      I have the following problem. I'm working on a solution for the owner of several restaurants. Each restaurant has meetings once or twice a month. How would I structure the tables so that I could have a layout on which I select a restaurant and then inside a portal I get a list of all employees. On the portal for each row I want to have a button or checkbox to mark if an employee is present or not.
      I already have the following tables:
      Restaurants, Employees and Meetings
      So far I have a relationship between the Restaurants and Employees table which I use to assign employees to a restaurant, and a relationship between the Meeting and Restaurant table, which allows me to show all employees that work at a selected restaurant using a portal on the meetings layout. How do I proceed to solve my problem? Do I create another table MeetingAttendees or something similar that I use to keep track of people attending a meeting? How would I create a relationship then to allow me to mark certain employees as present and absent?
      Thanks in advance,
      Mike
×

Important Information

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