Results 1 to 9 of 9
Like Tree2Likes
  • 2 Post By Tolls

Thread: Problem with text files

  1. #1
    manou2324 is offline Member
    Join Date
    Mar 2013
    Posts
    56
    Rep Power
    0

    Default 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)

    Please where is the mistake???

  2. #2
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,620
    Rep Power
    5

    Default 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
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

  3. #3
    gellegbs is offline Member
    Join Date
    Apr 2013
    Location
    USA
    Posts
    7
    Rep Power
    0

    Default 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. #4
    manou2324 is offline Member
    Join Date
    Mar 2013
    Posts
    56
    Rep Power
    0

    Default 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. #5
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,016
    Rep Power
    20

    Default 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...
    jim829 and gellegbs like this.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  6. #6
    manou2324 is offline Member
    Join Date
    Mar 2013
    Posts
    56
    Rep Power
    0

    Default 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. #7
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,016
    Rep Power
    20

    Default 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?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  8. #8
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,541
    Blog Entries
    7
    Rep Power
    20

    Default Re: Problem with text files

    Quote Originally Posted by Tolls View Post
    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,

    Jos (you already knew that)
    cenosillicaphobia: the fear for an empty beer glass

  9. #9
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,016
    Rep Power
    20

    Default Re: Problem with text files

    Quote Originally Posted by JosAH View Post
    Jos (you already knew that)
    As I said earlier, my crystal ball's broken...:(
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. Replies: 2
    Last Post: 06-11-2011, 01:54 PM
  2. Help. two text files
    By Sedas in forum JDBC
    Replies: 10
    Last Post: 10-05-2010, 08:09 AM
  3. working with files (text files)
    By itaipee in forum New To Java
    Replies: 1
    Last Post: 02-24-2009, 11:38 AM
  4. Behaving text files like binary files
    By Farzaneh in forum New To Java
    Replies: 2
    Last Post: 08-27-2008, 03:20 PM
  5. Text and image files within jar files
    By erhart in forum Advanced Java
    Replies: 8
    Last Post: 01-19-2008, 04:43 AM

Posting Permissions

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