I have a comma delimited file that looks kind of like this:
Upon reviewing the sample data you will see that sometimes a field will contain a single value, while other records contain fields with multiple values per field, separated by tabs within a single record field...
What I hope to do is parse the data into a file where those records with multiple values per field get split into multiple records, that is, the two sample records above would now look like this:
While the above sample only shows one record includinag a single set of extra values, many records contain numerous extra values within the fields.
As always, any help in overcoming this issue is greatly appreciated...
-Allen
Code:
"SERIAL","RO","CLOSED","MILEAGE","SWR","LABOR$","LBR-COST$","LBR-TYPE","PARTS$","PTS-COST$","MISC$","MISC-COST$","TECH","OP-CODES","SOLD-HOURS","STOCK-NO","OPENED","CLOSED"
"5TBBT4410YS090746",440480,"02APR01",15811,"733 733","30.00 0.00","25.50 0.00","CEMP IS","29.46 0.00",26.51,,,"136 136","YELLOW 10B","1.50 0.00","43082A","02APR01",""
"5TBBT4813YS097071",440218,"02APR01",7818,184,13.80,2.50,"W93",0.49,0.34,"","",416,74399,0.20,17690,"30MAR01",""
Upon reviewing the sample data you will see that sometimes a field will contain a single value, while other records contain fields with multiple values per field, separated by tabs within a single record field...
What I hope to do is parse the data into a file where those records with multiple values per field get split into multiple records, that is, the two sample records above would now look like this:
Code:
"SERIAL","RO","CLOSED","MILEAGE","SWR","LABOR$","LBR-COST$","LBR-TYPE","PARTS$","PTS-COST$","MISC$","MISC-COST$","TECH","OP-CODES","SOLD-HOURS","STOCK-NO","OPENED","CLOSED"
"5TBBT4410YS090746",440480,"02APR01",15811,"733","30.00","25.50","CEMP","29.46",26.51,,,"136","YELLOW","1.50","43082A","02APR01",""
"5TBBT4410YS090746",440480,"02APR01",15811,"733","0.00","0.00","IS","0.00",26.51,,,"136","10B","0.00","43082A","02APR01",""
"5TBBT4813YS097071",440218,"02APR01",7818,184,13.80,2.50,"W93",0.49,0.34,"","",416,74399,0.20,17690,"30MAR01",""
While the above sample only shows one record includinag a single set of extra values, many records contain numerous extra values within the fields.
As always, any help in overcoming this issue is greatly appreciated...
-Allen