Joined: 20 Oct 2006 Posts: 6968 Location: porcelain throne
are we to assume that there will only be the variables:
A, AB, AC and AD?
and there will only be 3 of the 4 variables in each record?
UNSTRING each record delimited by ',' (a comma) INTO 3 primary fields.
then unstring each field delimited by '=' (an equals sign) INTO 2 secondary fields.
secondary field 1 would contain the A,AB,AC or AD.
interrogation of each secondary field 1 (there will be 3) would tell which relative numeric field in the output the corresponding secondary field 2 would be placed.
ouput field 1, delimited by size,
ouput field 2, delimited by size,
ouput field 3, delimited by size,
ouput field 4, delimited by size,
INTO output record.
Joined: 06 Jun 2008 Posts: 8165 Location: East Dubuque, Illinois, USA
Your post is severely lacking in required information for a valid response.
Are the fields always going to be in A=, AB=, AC=, AD= order in the record (if present), or can they appear randomly?
Are the input values always going to be 2, 2, 4, 3 bytes or can they be different lengths? If different lengths, what are the minimum and maximum values?
Do you want the output values to be 2, 2, 4, 3 bytes? What is supposed to happen if any input value exceeds the output length?
Can any values be negative? If so, how are they to be handled (leading sign, trailing sign, ignore sign, sign overlay on the first byte, sign overlay on the last byte are some of the choices)
Finally, asking for code is considered impolite on this forum. What have you coded so far, and what is not working for you? The more you help yourself, the more willing we are to help you.