0

i am facing some problems with my android app, that uses csv to store user data. User can upload this file to google drive, and restore it later on. The thing is, while the file is uploaded it gets formatted, and it adds automatically [ ] and the and and start.

Here is how my original csv file looks like:

"ID","Latitude","Longtitude","Time","Date","Author","Address","City","State","Country"
"1","49.637221654315284","8.360934609005451","12:28","16.5.2016","Test User","Mainstreet 18","Berlin","null","Deutschland"

And here what i get as a result while uploading file to google drive.

[[[[ID,    Latitude,    Longtitude,    Time,    Date,    Author,    Address,    City,    State,    Country]]]]
[[1,  49.63441381871867,  8.364593093049526,  00:52,  16.5.2016,  Test User,  Teststreeet 18,  Berlin,  null,  Deutschland]]

Notice, the number of "[" depends, on how often i download the file and upload it again. It would be okay for me, if my text would be not moved while reading this text with opencsv.

For example i should get something like this:

Mainstreet 18

What i get when i restore file from drive, is:

  Mainstreet 18

It depends on how many "[" are before the text. The thing is, i tested it with the google drive app, when i upload the same file manually, and download it later, it becomes the same wrong way as above with stupid "[".

Is it a bug of google drive? Or should i format my csv other way? Thanks in advance for any help.

Wladislaw
  • 1,200
  • 2
  • 12
  • 23
  • Please, pay attention about what tags you use - "opencsv" is not the same thing as ["opencv"](http://opencv.org/). – Dan Mašek May 16 '16 at 17:01
  • @DanMašek thanks, it was auto filled, did not noticed it – Wladislaw May 16 '16 at 17:11
  • How exactly did you upload your csv? If you used Drive Android API, can you paste the code you made to upload the file? Also, did the same happen if you upload your csv directly through drive.google.com? – Prima May 19 '16 at 22:26

1 Answers1

0

I have found that it is easier to upload excel to sheets in Drive and then convert to csv there. Vice versa is true as well. Open drive csv as sheets and then download as excel. This always works for me.

Garima Jain
  • 1,247
  • 8
  • 6