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

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

Recommended Posts

Posted

I am working on a database that needs to be able to export data in "Fixed length Format". Is FileMaker capable of exporting data in this format?

I could not find any mention of this in my filemaker books or websites.

Posted

Hi 'BeckhamTX',

Quick answer... Yes, you can export 'fixed length' records.

Two important issues...

A. FMP does NOT create fixed length records... you have to create a calculation to 'pad' extra spaces to your data

B. FMP has no 'Fixed Length' file type option when exporting data... you have to use an existing file format

This said...

You could create a calc field that combines all the data from multiple fields and adds appropriate spaces between each piece of data. You could then export this data field to a 'Tab-Separated' file.

Posted

Hi BeckhamTX,

As Bob indicated, you need to create a calculation (text) and then export the calculation. This can be done by using something similar to:

Substitute(

Left(CustomerName & "(53 spaces)", 50) &

Left(LineItem::Total & Right(".00", Position(LineItem::Total & ".",".",1,1)+2-Length(LineItem::Total)) & "(15 spaces)", 12),...etc and then end with "

Posted

Thank you all for your answers. What I had started working on was a seperate (calculation) field for each existing field. And a last field concatanating all of the seperate calculated fields. I used Left(field, number of characters). For example, Left(Fname, 25). This works fine for records that have 25 characters or more in the field, taking the first 25 characters and giving me a fixed length of 25. but for records with less than 25 characters, such as Mike, it only produces a field with those four characters....how do i add a variable number of spaces to pad to the right of the name depending on the length of data that is too short. i thought of doing an If statement, if the length is < 25, take the data and add spaces by looping 25-length of data times. is this the correct approach to take?

Thank you for all of your help.

Posted

Hi,

My purpose of giving you the example calculation was to show you how to pad for each field if less than the total spaces, ie, Left(CustomerName & "(53 spaces)", 50). Unfortunately, Forum will remove the spaces so I put them in parentheses but you should actually put those spaces within the calculation.

And it's fine to make a calculation of each field to test and be sure the calculation will give you desired result. But I don't suggest you leave each field as a calculation and then combine all calculations into one for export.

Instead, once you know your format is correct for each field, copy and paste each individual field calculation into ONE calculation and place an & between them. Then delete all your individual 'test' calculations. This will be much more efficient. smile.gif

LaRetta

Posted

Hi again 'BeckhamTX',

LaRetta was right... you need to add 'spaces' to your data... and, use one text export field (if possible) to combine all your data into before exporting.

Here is a simple calc to understand the 'padding' process... you don't need 'looping':

- "exporttext" field = Left(namefield&"..................................................",50)

- [Calculation result is Text; UNCHECK Do not evaluate if all referenced fields are empty]

NOTE: the example above uses the "." (period) character instead of space characters for ease of understanding.

HOW IT WORKS...

- the contents of 'namefield' is combined with 50 spaces

- the result of this combining process is 'cut' to the first Left 50 characters

- the field options cause 'text' to be displayed even if the 'namefield' is blank

EXAMPLE RESULTS...

- Bob............................................... (47 spaces)

- .................................................. (50 spaces)

- Bob Kundinger..................................... (37 spaces)

- Now is the time for all good men to come to the ai (NO spaces)

Hope this helps... Good Luck!

Bob Kundinger

[email protected]

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