Page 1 of 1

"Shortname" for FIELD of DBF

Posted: Fri Jan 13, 2023 10:57 pm
by AUGE_OHR
hi,

when "read" XLSx via Excel ActiveX i often have "Header" which are longer than 10 Sign for FIELD in DBF
those "Header" Name can be equal on SUBSTR("Headername",1,10) so i need a "Shortname"

did somebody know a Way to get a unique "Shortname" from String which is longer than 10 Sign :?:

Re: "Shortname" for FIELD of DBF

Posted: Sat Jan 14, 2023 4:00 pm
by edk
I think you can store field names in an array and check if it already exist, if it does, change e.g. the last 2 characters to a random one (or some counter) and check again until they are unique.

Re: "Shortname" for FIELD of DBF

Posted: Sat Jan 14, 2023 8:32 pm
by AUGE_OHR
hi,
edk wrote: Sat Jan 14, 2023 4:00 pm if it does, change e.g. the last 2 characters to a random one (or some counter) and check again until they are unique.
OK, so i can use SUBSTR(x,1,8) + RANDSIGN(2) where last 2 Sign are random
thx for Idea :idea: