Results 1 to 3 of 3

Thread: FileWriter class in JAVA

  1. #1
    Join Date
    Sep 2009
    Posts
    44
    Rep Power
    0

    Default FileWriter class in JAVA

    HI everyone. I am new in forum. I have little bit knowledge of JAVA programming language .I attach to file and open it with FileWriter class and write in general, for that. Insert a line to the file, but now I would like to read the file and return a variable IP, a line like IP = 182.15.. And vary the IP. Any help would be highly appreciated. Thanks in advanced.

  2. #2
    Peter Gayle is offline Member
    Join Date
    Jul 2009
    Posts
    45
    Rep Power
    0

    Default

    In place of FileWriter you can use a FileReader. After that you can use a BufferedReader to read your file line by line (method "readLine ()). lastly, you examine your line to find out if it interests you or not.

  3. #3
    John Alster is offline Member
    Join Date
    Jun 2009
    Posts
    57
    Rep Power
    3

    Default

    I suggest you to refer following example of FileWriter class', which will give you something idea about the use of this class:
    For example:
    Here is the code for it
    Code:
    Properties pop = new Properties();
    d.load(new FileInputStream ("ton_fichier"));
    / / Mails to take the IP address
    d.getProperty("IP");
    //...
    Just try the following code and check if it works or not and reply me.

Similar Threads

  1. Polygon class in JAVA
    By Shane Robinson in forum Programming
    Replies: 2
    Last Post: 07-04-2010, 06:21 AM
  2. TextComponent class in java
    By TorresScott in forum Programming
    Replies: 3
    Last Post: 06-18-2010, 01:43 PM
  3. Using MediaTracker class in JAVA
    By MyersGray in forum Programming
    Replies: 2
    Last Post: 04-01-2010, 02:02 PM
  4. TextComponent class in java
    By AllenBrown in forum Programming
    Replies: 2
    Last Post: 03-08-2010, 01:59 PM
  5. JSeparator class of java
    By PerryCollins in forum Programming
    Replies: 2
    Last Post: 02-17-2010, 01:06 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48