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

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

Recommended Posts

Posted

Hello!

Here is my thing to solve. I do export records from a txt file, where fields are divided by commas. The database is build for a production factory. They divide the product in "Order, pack, and cott.". Cott is the smallest unit of product which navigates through the lines of production. I do get the number of Order and cott. from the txt file, but the number of pack is inserted manually. I want this to get done automatically. The concept is that the Order can be composed by one or more packs. The Pack in it's self is distinguished by the article used for the product. Packs are serial numbers (1, 2, 3, ...) inside the same Order. And it restarts 1,2,3,..., when Order changes number.

Hope I've been clear in explaining this. I can't find a way to do this automatically. Any one has an idea? It would be helpful.

Thanks Toni

Posted

There is a language problem with this phrase: "export records from a txt file"

You cannot export from a text file. You can export "to" a text file, or "import from" a text file. I'm assuming you mean "export to", though a similar technique could be used for an import also.

Also, there are 2 techniques. One is to automatically number the Packs during data entry. The other is to renumber the ones you have now, which don't have any numbers. It's a little tricky.

To automatically number the Packs during data entry you'd use a method called "serialize by category". Search for it at:

http://www.databasepros.com

Resources section

To renumber those you have, you'd use a looping script. It requires that you renumber ALL of any given Order at once; all must be in the Found Set. It could be run on all records, but that may be slow; it may however be the only safe way.

This will renumber the Pack# within each order, in the order in which they were entered in the database. If you need a different explicit order for Pack, then you need to include that criteria in the Sort.

I don't know what "product" has to do with this. You mention it, but don't say anything else about it.

Any fields with "_g" are global fields, of the same type as their corresponding field (if any).

Enter Browse Mode

Freeze Window

View As [ Form ]

Sort [ Sort Order: Order# ]

Set Field [ Order#_g, Order# ]

Set Field [ Pack#, 1 ]

Set Field [ CounterNum_g, 1 ]

Exit Record/Request

Loop

Posted

Oops, you are right Fenton, I did an error in typing, I do "import from a txt file". I guessed it is with Loop, but never been that familiar with it. I'll give a try and see what happens.

Thank you, Toni

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