File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to display 2 different file in IO java

 
ten chang
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey all,
how can i display content of two different fileName.txt file in a display one by one. IO java
 
Paul Clapham
Sheriff
Pie
Posts: 20203
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That depends on what "one by one" means. Could you clarify your question?
 
ten chang
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey paul,
the link below is my code, i need all the saved user input(lowerClassMan.txt and upperClassMan.txt) to display out one after another. i kinda have it running but the problem is i get only 1 data one from each. and when it display the data of lowerClass it shows in horizontal and upperClass in vertical. somthing like this :
d,f,3,44
d
c
6
77


http://www.coderanch.com/t/608898/java/java/save-file-condition-File-IO
 
Anayonkar Shivalkar
Bartender
Posts: 1557
5
Eclipse IDE Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

In the link mentioned by you, I found the code. But, that code does not read and/or write from/to file upperClassMan.txt. Are you sure this is the correct code? If not, please show us the code.

Also, I would follow simple logic:
1) counter = 0
2) Read line number 'counter' from file 1
3) Read line number 'counter' from file 2
4) counter++;
Keep on iterating from step 2 until both files are done.

Of course, this is very bare-bone logic. You'll need to consider what happens when both files are not having equal number of files, and/or if one file is empty etc. But first, let's see your code and also let us know about actual file contents.

I hope this helps.
 
ten chang
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oahh sorry, this is the full code
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic