Edit: If anyone could post something, that would be helpful or even just an insight, I ask you to do it.
Aloha,
Problem:
The data does not go into the database correctly, it skips around,
and makes up numbers that dont exist in the data file.
Some information:
I am writing a script that will take the information given it from a
text file and insert it into a MySQL database.
this information is comma delimited.
SEX,Frequency,Percent,ValidPercent,CumulativePercent,Valid,F,62
7,60.5,60.5,60.5,M,409,39.4,39.4,99.9,uk,1,.1,.1,100.0,Total,1037,
100.0,100.0,/nRES,Frequency,Percent,ValidPercent,CumulativePer
cent,Valid,INSTATE,416,40.1,40.2,40.2,OUTOFSTATE,155,14.9,15.0
,55.1,INDISTRICT,299,28.8,28.9,84.0,NONCREDIT,166,16.0,16.0,1
00.0,Total,1036,99.9,100.0,Missing,System,1,.1,Total,1037,100.0,/
nETH,Frequency,Percent,ValidPercent,CumulativePercent,Valid,NO
NRESIDENTALIEN,2,.2,.2,.2,BLACK,4,.4,.4,.6,NATIVEAMERICAN,3,.3,
.3,.9,ASIAN,18,1.7,1.7,2.6,HISPANIC,114,11.0,11.0,13.6,WHITE,77
2,74.4,74.4,88.0,NORESPONSE,124,12.0,12.0,100.0,Total,1037,10
0.0,100.0,/n
as you can see there are some sections of the data that are the
same througout the file (this is only a Very small peice of the file).
such as:
SEX,Frequency,Percent,ValidPercent,CumulativePercent,Valid
those sections of the file are first: Tablename, rest: table names,
i also insert a field called dataname before Frequency.
then the rest of the data is the data that goes into the file, in this
format,
F,627,60.5,60.5,60.5
where f is the data identifier then the rest is the data.
i have a loop that loops from F ot the end of the file and stores the data into arrays, then another loop that inserts the data into
the database from the array.
I would put the code, but its rather long, and i didnt want to put
a huge message on here if nobody thought they could help me
solve my problem.
I will post the code to the board if someone wants to help me
out, I would really appreciate it, because this is becoming a real
pain. I have attached the file, if that will help also.
Have a great day,
-=Levi=-