# Thread: Problem with text files

1. Member
Join Date
Mar 2013
Posts
56
Rep Power
0

## Problem with text files

Hi,

I have a java program that treates text files.There is a loop
Java Code:
     for(int k=0;k<6;k++) { //treatement }
for every valur of "k" it treates a text file "D:\\text"+k+".txt" (input) and gives another text file "D:\\file"+k+".txt"(output).
i tried with a short size files,as input,and it gives me the 6 text files (output) exact.

But my problem is when i try with more big size files (example:55 ko every one),my program gives me as input just the first file: file0 ,but no the other files (file2,file3,file3,file4 and file5)

2. Senior Member
Join Date
Jan 2013
Location
United States
Posts
2,722
Rep Power
4

## Re: Problem with text files

It would be easier to assist if you would provide a SSCCE to demonstrate the problem you are having.

Regrards,
Jim

3. Member
Join Date
Apr 2013
Location
USA
Posts
7
Rep Power
0

## Re: Problem with text files

{ //treatement }
is there a reason you are commenting out part of your code? You are leaving an open { and not closing it at the end by commenting

4. Member
Join Date
Mar 2013
Posts
56
Rep Power
0

## Re: Problem with text files

I write like this so that you understand that i have a treatement in my loop,this treatement works very well and gives me the exact output:
Java Code:
   for (int k=0;k<6;k++)
{
.........
// here is my treatement
...........
}
my probelm is: when i try with text files (input) (1 ko every one) ,my program works and gives me the six files(output)..but when i try with files (50 ko every file) my program gives me only the first text file (output) but not the others.

5. Moderator
Join Date
Apr 2009
Posts
11,302
Rep Power
18

## Re: Problem with text files

Then something in the code you are not showing us is not working.
My crystal ball's broken at the moment, so I can only guess...ommmmmm....ommmmmm...you are eating exceptions...

6. Member
Join Date
Mar 2013
Posts
56
Rep Power
0

## Re: Problem with text files

I write like this so that you understand that i have a treatement in my loop,this treatement works very well and gives me the exact output:
Java Code:
   for (int k=0;k<6;k++)
{
.........
// here is my treatement
...........
}
my probelm is: when i try with text files (input) (1 ko every one) ,my program works and gives me the six files(output)..but when i try with files (50 ko every file) my program gives me only the first text file (output) but not the others.

7. Moderator
Join Date
Apr 2009
Posts
11,302
Rep Power
18

## Re: Problem with text files

But that code does not show us what is wrong.
Look at the code you have posted.
How can anyone possibly say what is wrong with the code that does your file work based solely on that?

8. ## Re: Problem with text files

Originally Posted by Tolls
How can anyone possibly say what is wrong with the code that does your file work based solely on that?
Because we're psychic?

kind regards,

9. Moderator
Join Date
Apr 2009
Posts
11,302
Rep Power
18

## Re: Problem with text files

Originally Posted by JosAH
As I said earlier, my crystal ball's broken...:(

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•