Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 8 of 8

Thread: How to split a text file in no of chunks ?

  1. #1
    Junior Member
    Join Date
    Jan 2012
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How to split a text file in no of chunks ?

    How to split a file based on size by no of chunks ?

    I have a text file 5 MB data, now i want to split this into 5 parts with 1Mb each, in to some other directory ?

    is it possible to split a file without read or write method to split ?


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: How to split a text file in no of chunks ?

    is it possible to split a file without read or write method to split ?
    Hard to do if you don't read the bytes of the file and write them out again in other files.

    Perhaps you could call another program to do the reading and writing.

  3. #3
    Member
    Join Date
    Jan 2012
    Posts
    57
    My Mood
    Fine
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Default Re: How to split a text file in no of chunks ?

    here is the code buddy that i write to my self .. may be it will help u ..


    ...edited by moderator
    Last edited by copeg; January 30th, 2012 at 12:43 AM.

  4. #4
    Junior Member
    Join Date
    Jan 2012
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: How to split a text file in no of chunks ?

    @deependeroracle - Thnks mate It really useful

  5. #5
    Think of me.... Mr.777's Avatar
    Join Date
    Mar 2011
    Location
    Pakistan
    Posts
    1,136
    My Mood
    Grumpy
    Thanks
    20
    Thanked 82 Times in 78 Posts
    Blog Entries
    1

    Default Re: How to split a text file in no of chunks ?

    Read the Forums Rules deependeroracle. Though it was the help but more than help it's Spoon Feeding and it's the violation of Forums Rules.

  6. #6
    Member
    Join Date
    Jan 2012
    Posts
    57
    My Mood
    Fine
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Default Re: How to split a text file in no of chunks ?

    ur welcome .. but some how i was unaware of rules and mistakenly broke that ... means i did spoonfeeding

  7. #7
    Junior Member
    Join Date
    Sep 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: How to split a text file in no of chunks ?

    Hi deependeroracle--I have a similar problem, but I can not see your code here..Could you please upload it here again...Thanks

    Hasan

  8. #8
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 263 Times in 232 Posts

    Default Re: How to split a text file in no of chunks ?

    Hasan
    Read post #5
    Also check the date of a thread before you wake the dead

Similar Threads

  1. java code to split text documents into paragraphs and sentences
    By draksha in forum Java Theory & Questions
    Replies: 5
    Last Post: August 17th, 2011, 05:06 AM
  2. Replies: 8
    Last Post: March 25th, 2011, 02:34 PM
  3. Help me split and then join a file
    By babbupandey in forum What's Wrong With My Code?
    Replies: 0
    Last Post: December 13th, 2010, 12:20 PM
  4. java program to copy a text file to onother text file
    By francoc in forum File I/O & Other I/O Streams
    Replies: 3
    Last Post: April 23rd, 2010, 03:10 PM
  5. Reading Chunks of Data
    By icu222much in forum File I/O & Other I/O Streams
    Replies: 1
    Last Post: March 22nd, 2010, 08:39 PM