Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Can you export records into seperate files?


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

Recommended Posts

Posted

Hi there,

Had some great responses before so thought I'd try my luck again :-)

See my attached file-sample of what we have. I'd like to know if there is a seperate field/script which could be used to export the records based on the first field.

First set of records begin with B3RA,next set begin with B3RB,next set B3RC amd so on. Can something be done to export individual records, into seperate .csv files, based on their first 4 (or 5 or 6 or 7 etc) figures?

Thanks in advance

sample file.txt

Posted

Hi cabsandy,

Yes, it is possible to parse out the information into separate fields and records.

The information is very consistent from what I can tell, so if you are looking to create a record for each line and a Field for each group of information such as:

Field 1 = B3RAB03

Field 2 = 172.26.129.147

Field 3 = 00

Field 4 = 20

Field 5 = 40

etc.

The method to do this can range in how you are receiving the information now. The easiest way to do this is to run it through a text editor such as BBEdit or TextPad, and if the pattern fits the above, all you need to do is to substitute a Tab for each Space and then import that into your FileMaker File.

Another way is to parse the information within FileMaker using a Script or Separate Calculation Fields for each bit and using the pattern function.

If you need some assistance with either the calculation or the script let me know.

HTH

Lee

Posted

Lee,

Thanks as ever for the quick reply-though I think I may not have explained it as clealry as I should. The text file attatched comes from a complete .csv file, which in itself has been already exported from ,and using, FMP.

What I wish to do now with these records is group all the B3RA records into one group and export them to a seperate file called ,say, B3RAcomplete.csv. Then do the same with the B3RB, B3RC etc groups as well. So would end up with one file in FPM which, when ran through a script, would output multiple files, each one containing its own seperate group of records. Hope this is a bit clearer and sorry for any confusion. Can it still be done?

Sandy

Posted

You could make a looping script that would run a Find on each version of your B3R field, export as per your criteria, then loop through and find the next batch.

Normally this kind of things works by having the loop set a global field to Field 1, run the find by using the contents of the global, then replacing the global field by incrementing (Field 1 + 1). In your alphabetic situation, incrementing might not work too well. You could make a workaround with a calc field filled with nested substitutions so it results in B3RA becoming 1, B3RB becoming 2, etc. (ignoring characters in positions 5 on, with a Left function wrapping around the substitutions) Run your find on this field and you could increment your loop counter based on this field as well.

The trouble will be to apply the correct file name to each batch. You'd want your loop to apply a file name based on the contents of a global field during each trip around the loop. To do this job, you'll need the Troi File plug-in, or something similar.

Steve Brown

Posted

Please forgive me for saying this, but are you sure you are not making this more difficult than it needs to be. I'm having a hard time trying to invision what your end result is going to be. Especially since you already have them in FM.

Why not use a relationship based on a calculation of the Left(text,4) function instead. I can send you a two file demo of this if you need it.

Lee

Posted

Lee,

I know it seems a bit weird-the set of records as it stands is one big file.You will have seen that they contain IP adddress. What we do currently is take the exported .csv file from FMP and import them into a 3rd party network managmenet system-at the moment we have one folder with 1000's of adddress;s, all in the same group.This can become very messy for the operators-hence the reason behind myself wanting to import them (the IP address's) as seperate folders,based on their 4 leading figures.

I'd appreciate you demo and help on this if possible.

Sandy

Posted

After reading your last message, I'm still confused, and I doubt that this file will do you much good. But here it is anyway.

I'm still not sure if the purpose is to archive, make available for use in the "Third Party Program", or to just see them as a group, such as this files shows???

Lee confused.gif

Temp Cabsandy.zip

Posted

I know this sounds alien to an FM person, but I know exactly what you mean. I have to interact with an old DOS application, and this requires me to export one single FM record as a .csv file. If I have twenty of these, I have to loop through and create a found set of one, export, then find the next one, and so forth. My files make DOS macros, with huge text calc fields in FM that fill in all the macro code. There are valid reasons to do this.

Steve Brown

  • 2 months later...
  • Newbies
Posted

I have the same requirement. I want to export each record as separate file whose file name is from a field in the record, such as the record number.

My idea is to copy the field data to the clipboard, then in the export dialog window, paste the clipboard data into highlighted "save as" window. Can the paste operation be done with FM scripting, or Applescript?

I would like to end up with, for example, 50 files that each have specific names.

In my case the files contain calculated html data from a FM database of item specs.

This topic is 7669 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.