Here's the problem:
I have an array that has information about users. Each entry is separated by a blank field in the array.
For this example let's say the data fields are ID, first, last, phone, and email. However, if a user doesn't have a value for a particular field, then it is omitted entirely.
So here is what the array looks like
users[0] = 45049345
users[1] = Bob
users[2] = Smith
users[3] = 789-456-1230
users[4] = [email protected]
users[5] =
users[6] = 63515987
users[7] = Joe
users[6] = Schmoe
users[8] = [email protected]
users[9] =
I want to loop this array and store the data for each user in a database, however I have no clue how to verify that I am storing the right information in the place because there is no pattern in the array. Since Joe doesn't have a phone number, his email is would be stored as his phone number. This would result in ever subsequent entry to be off by 1 index.
Any ideas on how to go about this?
P.S. I am using node.js
EDIT: here is an example of the actual data
021870143-14
lastName
firstName
U
5/16/1988
11/6/2008
A
11/6/2008 6:0:2
NF
245
MAIN ST.
101
NEW YORK
NY
10002
11/4/2008
34
SD1
MUNC1J-036
MAG1-1
LEG77
SENT34
CONG5
CNTY
34-1
10/27/2008 19:59:53
NF