Segmenting

Segmenting

am 08.01.2008 11:11:31 von Michael

I have a file with 30,000 records. I need to omit 10,000 records, then
export four files with 5000 records each: records 1-5000, 5001-10,000,
etc., so that together, all four contain the 20,000 non-omitted
records.

This seems like it may be easy, but I don't know how to do it. Can
anyone advise?

Re: Segmenting

am 08.01.2008 13:55:56 von jrijnb

Michael wrote:

> I have a file with 30,000 records. I need to omit 10,000 records, then
> export four files with 5000 records each: records 1-5000, 5001-10,000,
> etc., so that together, all four contain the 20,000 non-omitted
> records.
>
> This seems like it may be easy, but I don't know how to do it. Can
> anyone advise?

Open FileMaker, choose "FileMaker Help" from the Help menu, type
"export" into the search box, and read the section on "Export Records
script step"
There is a lot of useful information in that help file.


--
Hans Rijnbout
Utrecht, Netherlands

Re: Segmenting

am 08.01.2008 17:45:08 von schwandtg

On Jan 8, 4:11 am, Michael wrote:
> I have a file with 30,000 records. I need to omit 10,000 records, then
> export four files with 5000 records each: records 1-5000, 5001-10,000,
> etc., so that together, all four contain the 20,000 non-omitted
> records.
>
> This seems like it may be easy, but I don't know how to do it. Can
> anyone advise?

One way...

Close Filemaker. Duplicate the original file and give it new name.
Open the new file. Delete the unwanted records. Repeat.

Re: Segmenting

am 10.01.2008 00:38:46 von Helpful Harry

In article
<6413c420-ba64-426b-89ba-e3614e18cb9f@e10g2000prf.googlegroups.com>,
Michael wrote:

> I have a file with 30,000 records. I need to omit 10,000 records, then
> export four files with 5000 records each: records 1-5000, 5001-10,000,
> etc., so that together, all four contain the 20,000 non-omitted
> records.
>
> This seems like it may be easy, but I don't know how to do it. Can
> anyone advise?

There's numerous ways you could do this. Perhaps one of the easiest
would be to use a script to number the records and export them.

The general process would be:

- Find wanted records (you don't say how you are determining which
ones to omit)

- Sort the found records into whatever order is needed (if any)

- Temporarily number each record with it's position in the Found
Set (ie. first record is "1", second record is "2", etc.). This can be
done with a new field using the Replace command and the Get
(CurrentRecordNumber) function.

- Find records 1 - 5,000 and export them.

- Find records 5,001 - 10,000 and export them.

- Find records 10,001 - 15,000 and export them.

- Find records 15,001 - 20,000 and export them.

- Remove the temporary numbers ready for next time, otherwise some
records might be left with a number even though they are to be in the
omitted group next time.


Create a new Number field called RecordOrder, and then the basic script
would be something along the lines of:

# Find wanted records - however you are determining
# which records to be omitted

Sort [Restore, No dialog]
Replace [No dialog, RecordOrder, Get(CurrentRecordNumber)]

Enter Find Mode []
Set Field [RecordOrder, "1...5000"]
Perform Find []
Sort [Restore, No dialog]
Export Records [Restore, No dialog, "File 1-5000.txt"]

Enter Find Mode []
Set Field [RecordOrder, "5001...10000"]
Perform Find []
Sort [Restore, No dialog]
Export Records [Restore, No dialog, "File 5001-10000.txt"]

Enter Find Mode []
Set Field [RecordOrder, "10001...15000"]
Perform Find []
Sort [Restore, No dialog]
Export Records [Restore, No dialog, "File 10001-15000.txt"]

Enter Find Mode []
Set Field [RecordOrder, "15001...20000"]
Perform Find []
Sort [Restore, No dialog]
Export Records [Restore, No dialog, "File 15001-20000.txt"]

Show All Records
Replace [No dialog, RecordOrder, ""]


The only problem here is if you need to go to more than record "20000".
If the database is going to need to grow, then this script may have to
use a loop instead of finding the specific hard-coded values.


Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)