length of string that contains spaces

jquickuk

Registered User.
Local time
Today, 07:21
Joined
Mar 18, 2009
Messages
12
Hi everyone,

I wonder if someone can help me.

I have a database that imports product files from suppliers. It is a string of 96 characters and I want to be able to vaildate the length of certain fields.

I import the file with no problems but I want to be able to vaildate the length of the string.

I can get the length of each field ok apart from the description field because it contains spaces.

....000001500|0000|0000|This is a description of the product |GBP|GB

I do import fixed width and use a import spec to do so but if the supplier puts a description less than 40 characters it looks like this.

....000001500|0000|0000|This is a description of the product G|BPG|B

I am quite happy to fill the spaces with zero's then work out the length from that.

If anyone can help me with that or has a better idea then i am all ears!!

Thanks
 
Spaces in the the middle of a string should not affect the length of the screen. Can you show the code you use to split the string into the fields?
 

Users who are viewing this thread

Back
Top Bottom