I am working on a data analysis project and I need to split a non-table (not an array yet) database into arrays. The database looks like this:
57, Federal-gov, 337895, Bachelors, 13, Married-civ-spouse, Prof-specialty, Husband, Black, Male, 0, 0, 40, United-States, >50K
38, Private, 28887, 11th, 7, Married-civ-spouse, Sales, Husband, White, Male, 0, 0, 50, United-States, <=50K
41, State-gov, 101603, Assoc-voc, 11, Married-civ-spouse, Craft-repair, Husband, White, Male, 0, 0, 40, United-States, <=50K
As you see the different variables/columns are split by commas. I am wondering about what the most efficient way to split this data into separate arrays (each column/ variable becomes a separate array entry) would be. The code should receive this database and then go through each line and set a new array entry with the appropriate value. For now I am fine with using a string array. As well I would like to also remove from the database lines with uncompleted info (missing data expressed as a ?). Any help will be appreciated :). If you have any questions feel free to ask. I am working in Java 1.7. Thanks!