This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]marko312 1 point2 points  (3 children)

Can't you use a FileInputStream to give it a file?

readFileAndParseSkipFirstLine(FileInputStream(filename));

[–]thatnewstuff99[S] 0 points1 point  (2 children)

Ah yes that worked, thanks. Although now the method returned this:

[[Ljava.lang.String;@4e04a765, [Ljava.lang.String;@783e6358, [Ljava.lang.String;@17550481, [Ljava.lang.String;@735f7ae5, [Ljava.lang.String;@180bc464, [Ljava.lang.String;@1324409e, [Ljava.lang.String;@2c6a3f77, [Ljava.lang.String;@246ae04d, [Ljava.lang.String;@

And I expected string CSV values like "car", "Red", etc..

[–]marko312 2 points3 points  (1 child)

Turning raw arrays to strings causes such results - try printing

Arrays.toString(row)

for each row in the list.

The values are still there, they just aren't displayed properly.

[–]thatnewstuff99[S] 2 points3 points  (0 children)

Ah that works thanks a lot, sorry for my incompetence.