Skip to main content
Hi all,

 

 

I have a set of MapINFO TAB files that are coming from SQL. Their field widths are defaulted to CHAR 254. I would like to truncate the field widths to fit the largest width of the field's contents.

 

 

For instance,

 

FIELD1 CHAR 254 having rows aaaaa bb ccccccc dddd eeeee fffff ggggg

 

become truncated to

 

FIELD1 CHAR 7 

 

7 being the largest width of all the rows of FIELD1

 

 

Any help would be appreciated.

 

 

Thiru
Hi,

 

 

You can use "string length @Value(Field1)" to claculate the length.

 

 

Then you can for instance use a stististicscaluclator grouped by Field1 to get the -max value.

 

Then create concatenatenation "Field1 CHAR @Value(_max)" (space delimited in this example)

 

Then you can use  a Filewriter to create a schema file with 1st row "attribute Format"

 

and subsequent rows the created strings.

 

So ti looks like:

 

bute Format

 

Field1 CHAR @Value(7)

 

 

After this u can use a schemamapper to map this schema.

 

 

If fields are "unknowns" or if there are many fields, you need/can to use a attribute eploder to acces the "uknown" filednames.

 

 
Thanks so much Gio, I will try these. 

Reply