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

How to import a flat file (not delimited)


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

Recommended Posts

Posted

I need to create a script to import a file into my database, that is not tab delimeted (a flat file). Its records are defined with a return, however each field is a designated number of characters long and not separated.

Eg:

field 1 = 9 characters

field 2 = 30 characters

field 3 = 10 characters etc.

There are no tabs, commas or semicolons separating the fields.

Thanks for any help!! Much appreciated.

Posted

Import into a temp table (with the entire record mapped to a single field). In this table, define calculation fields to parse out field data, e.g.

cField1 = Left ( ImportedField ; 9 )

cField2 = Middle ( ImportedField ; 10 ; 30 )

and so on. Now import the temp records into your real table, mapping the calc fields to your real fields.

You could also import directly into your real table, and use auto-entered calculations in your real fields - but that "dirties up" your table with redundant data and can interfere with normal operations (for instance, if you need another auto-entered calculation when a new record is created manually).

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