Results 1 to 5 of 5
  1. #1
    javasaravanan is offline Member
    Join Date
    Nov 2009
    Posts
    4
    Rep Power
    0

    Default How can we read text file in java 1.4

    Hi Experts,


    Here I have a text file such contains

    india @ 91
    Singapore @ 0065

    The delimeter is @

    here I have to read that text file and
    put the values in to two variable like wise

    String Country = "india"
    String code = "91"

    String Country = "singapore"
    String code = "0065"

    Can you help me to overcome this issues..
    Last edited by javasaravanan; 12-01-2009 at 07:31 AM.

  2. #2
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    11

    Default

    String.split("<pattern>")

  3. #3
    javasaravanan is offline Member
    Join Date
    Nov 2009
    Posts
    4
    Rep Power
    0

    Default Please Give me sample entire code

    I am a new one for java technologies

  4. #4
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,429
    Rep Power
    10

    Default

    Quote Originally Posted by javasaravanan View Post
    Please Give me sample entire code
    You're joking, right?
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  5. #5
    RamyaSivakanth's Avatar
    RamyaSivakanth is offline Senior Member
    Join Date
    Apr 2009
    Location
    Chennai
    Posts
    878
    Rep Power
    9

    Default

    1.Store the string "india @ 91" into some variable

    2.then do the split with "@" as delimiter
    Ramya:cool:

Similar Threads

  1. Read from a text file?
    By aaronfsimons in forum New To Java
    Replies: 3
    Last Post: 05-01-2009, 04:42 AM
  2. read from text file
    By rayda in forum New To Java
    Replies: 5
    Last Post: 04-10-2009, 03:51 AM
  3. Read and modify text file
    By heartysnowy in forum New To Java
    Replies: 27
    Last Post: 11-19-2008, 11:03 AM
  4. [SOLVED] How do I read from a text file
    By matzahboy in forum New To Java
    Replies: 5
    Last Post: 11-17-2008, 05:47 AM
  5. 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, 10:13 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
  •