Read and split text file into an array - Android

前端 未结 4 813
说谎
说谎 2020-12-22 05:07

I have gone through loads of these questions but still cant seem to figure it out. I have a text file split into rows. Each row consists of 5 pieces of data separated by a \

4条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-22 05:25

    /* Assuming you want a 5 by n matrix from this data
    John,22,1953,Japan,Green
    Anna,18,2012,Mexico,Blue
    Sam,34,1976,San Francisco,Pink
    .
    .
    .
    .
    nth row
    
    String[] row = s.split(","); */
    for (int i = 0; i

提交回复
热议问题