Thanks for the answer. Here is the initial array.

arr[0]=1201 0 "userid" 1202 0 "lname" 1203 0 "mname" 1204 0 "lname" 1217 
0 "password"
arr[1]=
arr[2]=4 0 emailaddress
arr[3]=1201 0 "userid" 1202 0 "lname" 1203 0 "mname" 1204 0 "lname" 1217 
0 "password"
arr[4]=
arr[5]=1201 0 "userid" 1202 0 "lname" 1203 0 "mname" 1204 0 "lname" 1217 
0 "password"

The email address line is random depending if the user inputed one or 
not and may or may not show up.

I want to end up with this :

arr[0]=userid::lname::mname::lname::password::emailaddress
etc

In the end I iterate over this array and input the info data into a 
database. I don't think I can combine both loops because I need to check 
index for the email and if found go back to index-1 for the rest of the 
info and then input into database.

Also instead of using arr.delete("") could I not use 
arr.delete(/[^14}*/), but does not seem to work.



@7stud : Good catch about the first entry not having 1201, I missed 
that, but there is no chance of that happening.

-- 
Posted via http://www.ruby-forum.com/.