please help to solve this pblm


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: please help to solve this pblm

  1. #1
    Join Date
    Oct 2006
    Posts
    28

    please help to solve this pblm

    iam reading some value from a file and write to another file.In the reading file contains
    <edm:fromReference>268520629#268771030</edm:fromReference>
    <edm:OrderItem>
    <edm:Order orderID="1024560"/>
    <edm:fromReference>1024560</edm:fromReference>
    <edm:fromLegalEntity legalEntityID="01000908">
    <edm:Identifier>01000908</edm:Identifier>
    </edm:fromLegalEntity>
    </edm:OrderItem>
    these following i want output 1024560 (<edm:fromReference>) inside order item .......in the above case(<edm:fromReference>) comes two times but inside<edm:OrderItem>&</edm:OrderItem>i only need.....these are differnt lines.....can any body please help with code
    the following code iused
    final String START4_TAG= "<edm:fromReference>";
    final String END4_TAG= "</edm:fromReference>";
    boolean efound=false
    if(line.indexOf(START4_TAG) > -1 ) { //this code handle edm.from refernce
    start6Pos = line.indexOf(START4_TAG);
    System.out.println("start pos"+start6Pos);
    System.out.println("index"+START4_TAG);
    start6Pos += START4_TAG.length();
    end6Pos = line.indexOf(END4_TAG);
    System.out.println("end pos"+end4Pos);
    efound10=true;
    //while (endPos == -1 && line != null)

    }
    else
    efound10=false;
    iwant to change what need to be handle above situation
    have no time to implement xml parser,and file is not fully xml...i showed some part of file......all remaining may be just text file.Therfore please tell whta modification i neeed to done above code

  2. #2
    Join Date
    Dec 2005
    Posts
    97
    um ok, well tell me if im understanding you correctly. you just want a program to read through the text file above and then locate/print out 1024560? if so, you could just read in the file, locate "<edm:fromReference>", and then use StringTokenizer to just cut out the number.

  3. #3
    Join Date
    Oct 2006
    Posts
    28
    u r correct yaar,iam using above code,can u tell me what modification needed in exisiting code

Similar Threads

  1. ActiveX problem using VB
    By koraal in forum VB Classic
    Replies: 3
    Last Post: 11-03-2006, 03:50 PM
  2. If else statement problem and solve
    By Mansur in forum C++
    Replies: 4
    Last Post: 10-18-2005, 08:21 AM
  3. Replies: 0
    Last Post: 09-23-2005, 02:17 AM
  4. Server.CreateObject Error- How to solve?
    By Bee Kiat in forum ASP.NET
    Replies: 3
    Last Post: 07-21-2000, 04:41 PM
  5. How to solve unexpected font mapping
    By Rattagarn V. in forum VB Classic
    Replies: 0
    Last Post: 06-27-2000, 11:39 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
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center