Split Large Text Field into several smaller fields
George
flowersoft at compuserve.com
Thu Jan 3 22:00:52 PST 2008
-----Original Message-----
From: filepro-list-bounces+flowersoft=compuserve.com at lists.celestial.com
[mailto:filepro-list-bounces+flowersoft=compuserve.com at lists.celestial.com]
On Behalf Of Scott Walker
Sent: Thursday, January 03, 2008 4:17 PM
To: Filepro_List
Subject: Split Large Text Field into several smaller fields
Does anyone have a couple of lines of code to take a 200 character
description field (I imported it from a customer supplied text file) and
break it up into (4) 54 character description fields (how my filePro
application has it stored). I don't want it to break in the middle of a
word or Part# so I guess it has to know when it does not have enough
room left for word it is on and therefore should not put it in the
current description field but start at that point as it puts data into
the next description field.
I know I can figure this out but I hoped someone might already have
invented this wheel.
Regards,
Scott
Scott Walker
RAM Systems Corp.
ScottWalker at RAMSystemsCorp.com
Ph: (704) 896-6549
Fx: (704) 896-7458
Although I haven't tested it, something like this should work:
If:
Then: ky=""{200 character field{""
LOOP1
If:
Then: pt="54" 'pointer
LOOP2
If: pt="1"
Then: pt="55"; goto JUMP1
If: mid(ky,pt,"1") ne ""
Then pt=pt-"1"; goto LOOP2
JUMP1
If: aa=""
Then: aa=""{mid(ky,"1",pt-"1"); goto JUMP2 'first 54 character field
If: ab=""
Then: ab=""{mid(ky,"1",pt-"1"); goto JUMP2 'second 54 character field
If: ac=""
Then: ac=""{mid(ky,"1",pt-"1"); goto JUMP2 'third 54 character field
If:
Then: ad=""{mid(ky,"1",pt-"1"); goto JUMP2 'fourth 54 character field
JUMP2
If: pt="55"
Then: pt="54"
If:
Then: ky=""{mid(ky,pt+"1","200")
If: len(ky) gt "0"
Then: goto LOOP1
If:
Then: end or do something else.
More information about the Filepro-list
mailing list