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 20 of 20

Thread: Buffered Reader to display file content after calcuation

  1. #1
    Member
    Join Date
    May 2008
    Posts
    35
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Buffered Reader to display file content after calcuation

    i am having data like this:Input say it as a.txt

    S.No Description Qty. Units Rate (Rs.) Value (Rs.)
    1 Aviation Lamp 1 Nos 3700 3,700
    2 Lighting Arrester 1 Nos 1600 1,600
    3 Aviataion Lamp Cable 31 Rmt 270 8,370

    Gross Total 13,670
    The above Total include Services Tax Amount of Rs 536
    Total Invoice Value 13,670

    i would like to get this data in the form of:Output should be

    S.No 1
    Description Aviation Lamp
    Qty. 1
    Units Nos
    Rate (Rs.) 3700
    Value (Rs.) 3700

    S.No 2
    Description Lighting Arrester
    Qty.1
    Units Nos
    Rate (Rs.) 1600
    Value (Rs.) 1600

    S.No 3
    Description Aviataion Lamp Cable
    Qty.31
    Units Nos Rmt
    Rate (Rs.) 270
    Value (Rs.) 8,370

    Gross Total 13,670
    Tax Amount of Rs 536
    Total Invoice Value 13,670

    --------------------------------

    I tried with Buffered Reader, String Buffer used some regex code.but i am unable to get this..can any body help me in this..one more thing i want s to generate this should work dynamically...If we give any input .txt file the corresponding text should be convert into that format
    Last edited by jazz2k8; May 13th, 2008 at 06:54 AM.


  2. #2
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 294 Times in 227 Posts
    Blog Entries
    4

    Question

    This will actually be quite complicated although I have a few ideas on how I would do it.

    Will this file always be in this format/order?

    Let me know and I will write some code for you..

  3. #3
    Member
    Join Date
    May 2008
    Posts
    35
    Thanks
    0
    Thanked 1 Time in 1 Post

    Thumbs up

    Thanks for your reply...

    S.No Description Qty. Units Rate (Rs.) Value (Rs.) these fields must be same for every invoice..but the particulars may vary...i have written code like this:
    import java.io.BufferedReader;
    import java.io.FileNotFoundException;
    import java.io.FileReader;
    import java.io.IOException;
    import java.util.regex.Matcher;
    import java.util.regex.Pattern;

    public class Sampleexpense {

    private int i;

    public static void main(String args[]) throws FileNotFoundException, IOException {
    int i;
    String[] substr;
    String sub = null;
    String res = null;
    BufferedReader in = new BufferedReader(new FileReader("C:\\Documents and Settings\\abb\\Desktop\\test\\Invo.txt"));
    StringBuffer sb = new StringBuffer();
    String line;
    line = in.readLine();

    while (line != null) {
    sb = sb.append(line);
    line = in.readLine();
    }



    String line1 = sb.toString();
    //System.out.println(line1);
    sub = line1.substring(line1.indexOf("Value (Rs.)"), line1.indexOf("Gross Total"));

    sub = sub.replace("Value (Rs.)", "");
    // System.out.println("Sub String " + sub);
    res = sub;
    Matcher tabledata = Pattern.compile(("\\d*,\\d{3}"), Pattern.CASE_INSENSITIVE).matcher(sub);
    i = 0;
    while (tabledata.find()) {

    i++;
    }



    String[] table = new String[i];
    Matcher tdata = Pattern.compile(("\\d*,\\d{3}"), Pattern.CASE_INSENSITIVE).matcher(sub);
    for (int ij = 0; ij < i; ij++) {
    while (tdata.find()) {
    table[ij] = tdata.group();

    break;
    }

    }
    String[] res1 = new String[i];
    for (int ik = 0; ik < i; ik++) {
    //System.out.println(" output " + table[ik]);
    res1[ik] = String.valueOf(ik + 1);
    }

    for (int a = 0; a < i; a++) {

    //System.out.println("Number "+(a+1)+" "+table[a]);

    sub = sub.substring(sub.indexOf(res1[a]), sub.indexOf(table[a]));

    System.out.println(" " + sub + table[a]);


    res = res.replace(sub + table[a], "");
    sub = res;

    }
    }
    }
    Output:
    1 Aviation Lamp 1 Nos 3700 3,700
    2 Lighting Arrester 1 Nos 1600 1,600
    3 Aviataion Lamp Cable 31 Rmt 270 8,370

    Can you simplify it!!!????

  4. #4
    Member
    Join Date
    May 2008
    Posts
    35
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    Here i tried with some other code also:

    But giving some errors:

    Please have a look:

    public class TabData2 {

    static String Sno,Qty,Description,Unit,Rate,Value;
    public static void main(String args[]) throws FileNotFoundException{
    File file = new File("D:\\bharath\\CSV\\tab2.txt");
    StringBuilder sb = new StringBuilder();
    Scanner scanner = new Scanner(file);
    while (scanner.hasNextLine()) {
    // String line = scanner.nextLine();
    // while(scanner.hasNext()){
    Sno = scanner.next();
    Description = scanner.next();
    Qty = scanner.next();
    Unit = scanner.next();
    Rate = scanner.next();
    Value = scanner.next();
    Formatter fmt=new Formatter();
    fmt.format("%s\n",Sno);
    fmt.format("%s\n",Description);
    fmt.format("%s\n",Qty);
    fmt.format("%s\n",Rate);
    fmt.format("%s\n",Value);
    // fmt.format("%5$2S,%4$2s,%3$2s,%2$2s,%1$2s" );

    System.out.println(Sno);
    System.out.println(Description);
    System.out.println(Qty);
    System.out.println(Rate);
    System.out.println(Value);

    }

    }
    }


    Output:

    sno
    Description
    Qty.
    Rate
    (Rs.)
    Value
    (Rs.)
    1
    Lamp
    1
    Nos
    3700
    3,700
    Lighting
    Arrester
    1
    Nos
    1600
    3
    Aviataion
    Lamp
    Cable
    31
    270
    8,370
    Gross
    Total
    13,670
    above
    Total
    include
    Services
    Tax
    of
    Rs
    536
    Total
    Invoice
    I
    13,670
    Now
    Claimed
    100%
    Invoice
    Value
    13,670
    (Rupees
    Thirteen
    Six
    Hundred
    and
    Seventy
    only)
    Description
    Qty.
    Rate
    (Rs.)
    Value
    1
    Lamp
    1
    Nos
    3700
    Lighting
    Arrester
    1
    Nos
    1600
    Aviataion
    Lamp
    Cable
    31
    270
    Gross
    Total
    13,670
    above
    Total
    Services
    Tax
    of
    Rs
    536
    Invoice
    I
    13,670
    Now
    Claimed
    Invoice
    Value
    Exception in thread "main" java.util.NoSuchElementException
    at java.util.Scanner.throwFor(Scanner.java:838)
    at java.util.Scanner.next(Scanner.java:1347)
    at TabData2.main(TabData2.java:31)
    ..I can understand the Exception The given file has 47 elements. Each time i am reading bundle of 6 elements. So what happened is, in last read i have only 5 elements. No 6th element.

    so..got an exception...

    can u look these two let me know the status ...thanks

  5. #5
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 294 Times in 227 Posts
    Blog Entries
    4

    Default

    I'm not too sure if that code is the best way to do it..

    I'm currently working on solving this problem for you so ill post back as soon as its done!

  6. #6
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 294 Times in 227 Posts
    Blog Entries
    4

    Talking

    Hey Jazz. Try this my friend.

    Input:

    S.No Description Qty. Units Rate (Rs.) Value (Rs.)
    1 Aviation Lamp 1 Nos 3700 3,701
    2 Lighting Arrester 1 Nos 1600 1,601
    3 Aviataion Lamp Cable 31 Rmt 270 8,370
    Gross Total 13,670
    The above Total include Services Tax Amount of Rs 536
    Total Invoice Value 13,670

    Jazz3 Class:

    import java.io.*;
    import java.util.Scanner;
    import java.util.regex.*;
     
    public class Jazz3 {
     
     public static String inputFile = "C:\\FILE_PATH\\input.txt";
     public static String outputFile = "output.txt";
     
     public String strLine;
     public int sno;
     public int qty;
     public String units;
     public int rate;
     public int value;
     Scanner sc;
     
     public void importFile()
     {
      try
      {
      Writer output = null;
      File file1 = new File(outputFile);
      output = new BufferedWriter(new FileWriter(file1));
      String newline = System.getProperty("line.separator"); 
     
      FileInputStream in = new FileInputStream(inputFile);
      BufferedReader br = new BufferedReader(new InputStreamReader(in));
      String prodLine = "(^[0-9])"; 
      String qtyLine = "([0-9])";
      Pattern p1 = Pattern.compile(prodLine);
      Pattern p2 = Pattern.compile(qtyLine);
     
      while((strLine = br.readLine()) != null)
      {
       Matcher m1 = p1.matcher(strLine);
     
       if (m1.find())
       {
        //System.out.println(m.group(0));   
        sc = new Scanner(strLine);
        sno = sc.nextInt();
        System.out.println("S.No " + sno);
        output.write("S.No " + sno);
        output.write(newline);
        String strLine2 = strLine.substring(2);
        Matcher m2 = p2.matcher(strLine2);
     
        if (m2.find())
        {
         String[] parts = strLine2.split(m2.group(0)); 
         System.out.println("Description: " + parts[0]);
         output.write("Description: " + parts[0]);
         output.write(newline);
     
     
         if (strLine2.contains(parts[0]))
         {
          strLine2 = strLine2.replace(parts[0], "");
         }
     
         Scanner sc2 = new Scanner(strLine2);
     
         for (int i = 0; i < 2; i++)
         {
             if (sc2.hasNextInt())
             {
                qty = sc2.nextInt();
                System.out.println("Qty. " + qty);
                output.write("Qty. " + qty);
                output.write(newline);
             }
             else
             {
               units = sc2.next();
               System.out.println("Units " + units);
               output.write("Units " + units);
               output.write(newline);
             }
         }
     
             if (sc2.hasNextInt())
             {
                  rate = sc2.nextInt();
                    System.out.println("Rate (Rs.) " + rate);
                    output.write("Rate (Rs.) " + rate);
                    output.write(newline);
             }
     
             if (sc2.hasNextInt())
             {
                  value = sc2.nextInt();
                    System.out.println("Value (Rs.) " + value);
                    output.write("Value (Rs.) " + value);
                    output.write(newline);
             }
     
        }
     
        System.out.println();
        output.write(newline);
       }
     
       if(strLine.contains("gross") | strLine.contains("Gross"))
       {
        String gross = strLine;
        System.out.println(gross);
        output.write(gross);
        output.write(newline);
       }
       if(strLine.contains("tax") | strLine.contains("Tax"))
       {
        String tax = strLine.replaceAll("The above Total include Services ", "");
        System.out.println(tax);
        output.write(tax);
        output.write(newline);
       }
       if(strLine.contains("invoice") | strLine.contains("Invoice"))
       {
        String invoice = strLine;
        System.out.println(invoice);
        output.write(invoice);
        output.write(newline);
       }
     
       //System.out.println(strLine);
      }
     
      System.out.println();
      System.out.println("Completed - Output file generated");
      output.close();
      in.close();
     
      }
      catch(IOException e)
      {
       System.out.println(e);
      }
     }
     public static void main(String[] args) {
     
      Jazz3 jazz3 = new Jazz3();
      jazz3.importFile();
     }
    }

    Output:

    S.No 1
    Description: Aviation Lamp 
    Qty. 1
    Units Nos
    Rate (Rs.) 3700
    Value (Rs.) 3701
     
    S.No 2
    Description: Lighting Arrester 
    Qty. 1
    Units Nos
    Rate (Rs.) 1600
    Value (Rs.) 1601
     
    S.No 3
    Description: Aviataion Lamp Cable 
    Qty. 31
    Units Rmt
    Rate (Rs.) 270
    Value (Rs.) 8370
     
    Gross Total 13,670
    Tax Amount of Rs 536
    Total Invoice Value 13,670

    Hope this works for you! I tested with more values in the input file and it seems to be generic

  7. #7
    Member
    Join Date
    May 2008
    Posts
    35
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    Great work..awesome

    Here i wants to give some more strain...lol:-)

    Attached is my invoice(Generated from an OCR Engine)..from that i would like to extract the information.

    My output shold look like:

    ASTER TELE SERVICES PVT. LTD.
    Flat no.4 to 7, C/o Krishna Plaza,
    Opp.Water Tanks, Near TATA Garden Busstop,
    Chandan Nagar, PUNE-14

    Invoice No: EMH48DCO56
    Date: 28-Dec-07
    P.O.NO: 4352
    Date: 28-May-07

    PAN No.AACCA5469L
    CST TIN is: 27150005249C w.e.f 01.04.2006
    VAT TIN is: 27150005249V w.e.f 01.04.2006
    ST Regn No. AACCA5469LST001

    To,
    Vodafone Essar Cellular Ltd.,
    -.L)Metropolitan, F/P No.27,
    S.No. 21, Old Mumbai-Pune Highway,
    Lighting Arrester
    Wakadewadi, Shivaji Nagar,
    PUNE - 411005

    Site Name: Gad Mudsingi
    Tower Type: RTT
    Tower Height: 21 Mts
    Natureof Work:Avaition Lamp

    +

    the previous output which we got in previous post..

    the above + was over but i am much more interested in yours code...i used regex for that.As it is my urgent requirement i am giving strain to you..



    The previous code was Working....First Post success...Hope the same for everytime...



    All the Best..i will be always in touch wd u buddy
    Attached Files Attached Files
    Last edited by jazz2k8; May 13th, 2008 at 06:34 AM.

  8. #8
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 294 Times in 227 Posts
    Blog Entries
    4

    Default

    Brilliant news!! Glad I could help

    I am looking to add a 'Mark Thread as Solved feature', but for now, could you please edit the thread title and add [SOLVED] infront of 'How to achieve this?'

    Thank you.

  9. #9
    Member
    Join Date
    May 2008
    Posts
    35
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    How to edit the title?
    Last edited by jazz2k8; May 13th, 2008 at 06:44 AM.

  10. #10
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 294 Times in 227 Posts
    Blog Entries
    4

    Default

    There is no option to mark thread as solved in the Thread tools currently on these forums. I am looking to add the plugin to do it ASAP.

    For now, can you please manually do it. Just click the 'Edit' button to edit the thread and add [SOLVED] to the front of the title.

  11. #11
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 294 Times in 227 Posts
    Blog Entries
    4

    Default

    Attached is my invoice(Generated from an OCR Engine)..from that i would like to extract the information.

    My output shold look like:

    ASTER TELE SERVICES PVT. LTD.
    Flat no.4 to 7, C/o Krishna Plaza,
    Opp.Water Tanks, Near TATA Garden Busstop,
    Chandan Nagar, PUNE-14

    Invoice No: EMH48DCO56
    Date: 28-Dec-07
    P.O.NO: 4352
    Date: 28-May-07

    PAN No.AACCA5469L
    CST TIN is: 27150005249C w.e.f 01.04.2006
    VAT TIN is: 27150005249V w.e.f 01.04.2006
    ST Regn No. AACCA5469LST001

    To,
    Vodafone Essar Cellular Ltd.,
    -.L)Metropolitan, F/P No.27,
    S.No. 21, Old Mumbai-Pune Highway,
    Lighting Arrester
    Wakadewadi, Shivaji Nagar,
    PUNE - 411005

    Site Name: Gad Mudsingi
    Tower Type: RTT
    Tower Height: 21 Mts
    Natureof Work:Avaition Lamp

    +

    the previous output which we got in previous post..

    the above + was over but i am much more interested in yours code...i used regex for that.As it is my urgent requirement i am giving strain to you..
    I will have a go at this for you but the last bit of code I did for you took me days to work out. This really is very complicated!!

    Are you also able to generate this output as a .csv file?

    If the output is comma seperated, it would be easier to work with.

  12. #12
    Member
    Join Date
    May 2008
    Posts
    35
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Re: How to achieve this?

    i never checked with csv...here i attached that one also..can u have a look at this..this looks very strange...if you are comfort with csv its not a big issue for me...


    I know it is very complicated issue but...

    your help is awesome...

    thanks for your time and support...

  13. #13
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 294 Times in 227 Posts
    Blog Entries
    4

    Default Re: How to achieve this?

    i never checked with csv...here i attached that one also..can u have a look at this..this looks very strange...if you are comfort with csv its not a big issue for me...
    I cannot see an attachment?

    What output are you looking for?

  14. #14
    Member
    Join Date
    May 2008
    Posts
    35
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Re: How to achieve this?

    here i am pasting the tab.csv..because in the attachments there is no csv option:

    "","","11:1/4)ASTER"
    "","","WE INTEGRATE COMMUNICATIONS"
    "fi•W ,","",""
    "R991 :","",""
    "INVOICE","","","","",""
    "ASTER TELE SERVICES PVT. LTD.","","Invoice No: EMH48DCO56","","",""
    "Flat no.4 to 7, C/o Krishna Plaza,","","Date: 28-Dec-07","","",""
    "Opp.Water Tanks, Near TATA Garden Busstop, Chandan Nagar, PUNE-14","","P.O.NO: 4352 Date:

    28-May-07","","",""
    "PAN No.AACCA5469L","","","","",""
    "CST TIN is: 27150005249C w.e.f 01.04.2006","","","","",""
    "VAT TIN is: 27150005249V w.e.f 01.04.2006 ST Regn No. AACCA5469LST001","","","","",""
    "To,","","Site Name: Gad Mudsingi","","",""
    "VIVodafone Essar Cellular Ltd.,","","Tower Type: RTT","","",""
    "-.L)Metropolitan, F/P No.27,","","Tower Height: 21 Mts","","",""
    "S.No. 21, Old Mumbai-Pune Highway,","","Natureof Work:Avaition Lamp, Lighting Arrester","","",""
    "Wakadewadi, Shivaji Nagar, PUNE - 411005","","","","",""
    "","","","","",""
    "S.No","Description","Qty.","Units","Rate (Rs.)","Value (Rs.)"
    "1","Aviation Lamp","1","Nos","3700","3,700"
    "2","Lighting Arrester","1","Nos",""",1600'","1,600"
    "3","Aviataion Lamp Cable","31","Rmt","' 270","8,370"
    "","","","","",""
    "","","","","",""
    "","Gross Total","","","","13,670"
    "","The above Total include Services Tax Amount of Rs 536","","","",""
    "","Total Invoice Value I","","","","13,670"
    "","","","","",""
    "","Now Claimed 100% of Invoice Value","","","","13,670"
    "(Rupees Thirteen Thousand Six Hundred and Seventy only) For ASTER TELE SERVICES PVT LTD","","","","",""
    "/ -","","","","",""
    "lk .","","","","",""
    "Authorised Signatory","","","","",""
    "ASTER TELESERVICES PVT.LTD."
    "4-7 Krishna Plaza, Opp. Water Tank, Near Tata Garden Bus Stop, Chandan Nagar, Pune - 411 014"

  15. #15
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 294 Times in 227 Posts
    Blog Entries
    4

    Default Re: How to achieve this?

    OK, and what would you want the output to be?

  16. #16
    Member
    Join Date
    May 2008
    Posts
    35
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Re: How to achieve this?

    please see the #11 post..

  17. #17
    Member
    Join Date
    May 2008
    Posts
    35
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Re: How to achieve this?

    My output shold look like:

    ASTER TELE SERVICES PVT. LTD.
    Flat no.4 to 7, C/o Krishna Plaza,
    Opp.Water Tanks, Near TATA Garden Busstop,
    Chandan Nagar, PUNE-14

    Invoice No: EMH48DCO56
    Date: 28-Dec-07
    P.O.NO: 4352
    Date: 28-May-07

    PAN No.AACCA5469L
    CST TIN is: 27150005249C w.e.f 01.04.2006
    VAT TIN is: 27150005249V w.e.f 01.04.2006
    ST Regn No. AACCA5469LST001

    To,
    Vodafone Essar Cellular Ltd.,
    -.L)Metropolitan, F/P No.27,
    S.No. 21, Old Mumbai-Pune Highway,
    Lighting Arrester
    Wakadewadi, Shivaji Nagar,
    PUNE - 411005

    Site Name: Gad Mudsingi
    Tower Type: RTT
    Tower Height: 21 Mts
    Natureof Work:Avaition Lamp

    +

    the previous output which we got in previous post..

    the above + was over but i am much more interested in yours code...i used regex for that.As it is my urgent requirement i am giving strain to you..

  18. #18
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 294 Times in 227 Posts
    Blog Entries
    4

    Default Re: How to achieve this?

    Well to get the pervious extracted information along side this new input would mean that I would have to completely re-write the previous code. This is a very, very complicated task!! It may even be above my skill level.

    I simply do not have the time to do all of this for you. I suggest you try to write this yourself and I will try to help you as you get stuck.

    The good thing about using a csv file is that you can use the "," as a delimiter which should help you to manipulate the data.

    Have you thought about contracting someone to do this work for you?

  19. #19
    Member
    Join Date
    May 2008
    Posts
    35
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Re: How to achieve this?

    Quote Originally Posted by JavaPF View Post
    Well to get the pervious extracted information along side this new input would mean that I would have to completely re-write the previous code. This is a very, very complicated task!! It may even be above my skill level.

    I simply do not have the time to do all of this for you. I suggest you try to write this yourself and I will try to help you as you get stuck.

    The good thing about using a csv file is that you can use the "," as a delimiter which should help you to manipulate the data.

    Have you thought about contracting someone to do this work for you?
    NoNo....not at all..dont mis understand me my friend...i tried with regular expressions...i got the answer...thanks for your time and support....

    ll b back with another new topic...hav a gr8 day

  20. #20
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 294 Times in 227 Posts
    Blog Entries
    4

    Default Re: How to achieve this?

    NoNo....not at all..dont mis understand me my friend...i tried with regular expressions...i got the answer...thanks for your time and support....

    ll b back with another new topic...hav a gr8 day
    Ah OK. Glad you got the answer. If you need any help in the future ill be happy to assist you.

    Please take a look at this link:

    http://www.javaprogrammingforums.com...-new-post.html
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.