Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Reading all files from a folder  RSS feed

 
Farakh khan
Ranch Hand
Posts: 833
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I am working with CV parsing project. I finish all the requirements and my code is reading the file, parsing and converting into HTML.

There are some previous CVs uploaded in one folder on the server. I want to read all files of this folder but don't know from where I start.

How can I read these 5K+ files with duplicate check with one program?

Best regards
 
Greg Charles
Sheriff
Posts: 3015
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not clear what the problem is here. You know how to read one file, so how is reading 5000 any different? Is it that reading so many files would take a really long time? There's no easy solution to that. You can use a profiler ... a tool that will show where your program runs slowly or uses too much memory. That might make the processing of each file a bit faster.

On the other hand, maybe you're asking about how to implement a duplicate check. That's a bit too vague for me to even guess at. You'd have to give us more information on what you mean for us to be able to help you there.
 
Paul Clapham
Sheriff
Posts: 22487
43
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You start with the listFiles() method of the java.io.File class.
 
Farakh khan
Ranch Hand
Posts: 833
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks all for helping.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!