Automatically Getting Sizes From Numbers? 关注

Legacy Poster

Our current product-database is built using articlenumbers containing both the color and the size of the product. Basically this means that each article no. contains product id, product color and product size.

For example, here is a shortend version of our Excel spreadsheet-"database":

Shirt, 1020103, regular tshirt
Shirt, 1020104, regular tshirt
Shirt, 1020111, regular tshirt
Shirt, 1020112, regular tshirt[/code]

The first four digits represents the actual product "shirt". The next two digits represents the color of the shirt, and the last digit represents the size. So in this example, if we say 10 = RED and 11 = BLUE, as well as the size-digits refering to sizes 1=S, 2=M, 3=L, 4=XL then this list would actually represent:

[code]Shirt, 1020103, regular tshirt // 10 for RED and 3 for L, so a RED shirt in size L
Shirt, 1020104, regular tshirt // 10 for RED and 4 for XL, so a RED shirt in size XL
Shirt, 1020111, regular tshirt // 11 for BLUE and 1 for S, so a BLUE shirt in size S
Shirt, 1020112, regular tshirt // 11 for BLUE and 2 for M, so a BLUE shirt in size M[/code]

Is it possible to automatically process this information when importing directly from said Excel spreadsheet into Bartender 9.4? Meaning, can we split up the articlenumber using some form of REGEXP or otherwise, then replacing the different digits with the correct colors (i guess this would have to be joined to another database to find correct information, OR it could be hardcoded as this information will not change).

1 评论

Michael Toupin (mtoupin
评论操作 固定链接

Sure. You'd just have to parse the data using VB, then you can do whatever you want with it. The easiest way would just be to use a right() or mid() statement to pull the characters you want, then assign the information using a select case or if...then statement.