exporting chunks of a file


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: exporting chunks of a file

  1. #1
    Join Date
    May 2005
    Posts
    1

    exporting chunks of a file

    hi there, how do i export a certain chunk of a file to many files
    not sure how to add those lines into the code ...
    Code:
      // process file line by line
        String line = inBuf.readLine();
    
       while (line != null) {
           // process line
           ...
           // read next line
           line = inBuf.readLine();
        }
    }
    things to export, those in bewteen the Part(bold) and the top header needs to be exported
    Code:
    ------=_Part_9_12864763.1115691979328
    Content-Type: text/xml; charset=utf-8
    
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <soap-env:Envelope
    	xmlns:soap-env="http://schemas.xmlsoap.or
    
    ------=_Part_9_12864763.1115691979328
    <soap-env:Envelope

  2. #2
    Join Date
    Dec 2003
    Location
    tx/us
    Posts
    131
    Save the separator string (sep) then as each line is read compare it to sep and to sep+"--". If the line matches the separator then it's the start of a new part, sep+"--" then it's the end of the last part, otherwise it's exported.

    See RFC 2387: http://www.faqs.org/rfcs/rfc2387.html

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