Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Dynamically Creating Files......  RSS feed

 
Francis John
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello to All.....
I just want to discuss with u people how to create dynamically files.....
I mean to say that.....in my scenario, A text file has to be divided into number of textfiles in such a way that the text which is a string should be divided equally.....
Suppose We have three clients....and as for a Server, It is the duty of Server to distribute text file among clients...The text file is already present at Server and it should be divided according to the number of clients....And The contents should be different in three files, As if there are 12 strings are there then each client will receive 4 strings jus t like load balancing......How I can make these files programmically?? Can anyone help me in this regard....
Take care all,
Bye....
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24215
37
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Generally one would use a FileReader/BufferedReader combination to read the original file, and PrintWriter/FileWriter combinations in a "for" loop to write the new files. What part do you need help with?
 
Francis John
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello to All....
Yes, U r right....I m working on FileReader/BufferedReader.But in my case, how i can name files and they are looking like separated files... by using in a single for loop as u ve mentioned earlier....
so now can u help me ....
ok
Bye
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24215
37
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Basically, do this:
 
Francis John
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Sir Ernest Friedman-Hill
Yes, It's working.Thanx a lot to give ur precious time...
ok
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!