Results 1 to 4 of 4
  1. #1
    hiklior is offline Member
    Join Date
    Apr 2008
    Posts
    9
    Rep Power
    0

    Default Read-File Write Display substring

    Hi ,

    I would appreciate if somebody could help me with this.

    I have a txt file with more than 4000 lines. I need to find a substring of 35 zeros '00000000000000000000000000000000000' and they could be in more than one place. This program should actually read from file to find those substring . If it find 35 zeros i need 10 digits in front of it for example if there was 15151515150000000000000000000000000000000000 i need 1515151515.This program should write those ten digits in a separate file in new line.

    example output

    1515151515
    1616161616
    1717171717

    I am new to java . just learning i would appreciate anykind of help i could get.

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Hi hiklior,

    Welcome to our community! :)

    How about the arrangement of a single line. I mean is there fix number of digits?

    What you have try up to now?

  3. #3
    sukatoa's Avatar
    sukatoa is offline Senior Member
    Join Date
    Jan 2008
    Location
    Cebu City, Philippines
    Posts
    556
    Rep Power
    7

    Default

    Have an experiment on Matcher class and Pattern class...

    It is useful...

    regards,
    sukatoa

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Quote Originally Posted by sukatoa View Post
    Have an experiment on Matcher class and Pattern class...

    It is useful...

    regards,
    sukatoa
    Yep, but sukatoa, if he doesn't know how to read a line from a file and write the result to a file :confused: Isn't it, going to be too difficult.

Similar Threads

  1. how to write onto a file
    By mirage_87 in forum New To Java
    Replies: 6
    Last Post: 09-08-2009, 03:54 PM
  2. DES algorithm (Read and Write bytes to file)
    By JoaoPe in forum Advanced Java
    Replies: 6
    Last Post: 07-29-2008, 03:46 PM
  3. How to read a text file from a Java Archive File
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 02-08-2008, 09:13 AM
  4. Replies: 0
    Last Post: 11-14-2007, 06:04 PM
  5. Simplest way to read and display a jpeg image
    By Hasan in forum New To Java
    Replies: 1
    Last Post: 05-31-2007, 03:42 PM

Posting Permissions

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