Want ot insert  a word bfeore last line

hi all,
i have finished reading strings from input files and displayed in outout file
but i want to add a word before last line in output file can u please help.....
regards,

Mostly your question from String and File concepts only...
i thought you are trying to do something in files
http://forum.java.sun.com/thread.jspa?messageID=9922403
http://forum.java.sun.com/thread.jspa?threadID=5226433
i modified your program and post in this thread (threadID=5226433) what you asked,
please go with the same code what you really added,
dont post new thread and asking in different way the same one....
avoid this...

Similar Messages

  • HTML Page - Inserting Key Words

    I am real new to this, so please be gentle.
    I am out of work and have created a web page (with IWeb) to hopefully generate some income. I want to insert Key Words on the HTML page. When I get to that page the code looks like I would insert the Key Words on the last line between the first ">" and the next "<" />Key Words<head><body></body></html>
    Would anyone know if this is correct?
    Thanx
    Citizen-Kane

    Try using the freeware SEO Tool....
    http://www.ragesw.com/products/iweb-seo-tool.html
    and search for keywords with.......
    http://www.ragesw.com/products/sekeyword.html

  • Insert One Word Document into another using OLE ABAP

    Hi,
    I want to insert one word document into another Word Document called by OLE ABAP.
    ie.first word document having 6 pages have been displayed and I want first page of
    second document as a 7th page.I want to dispaly the entire data in  one document.
    Hope to get the reply soon.
    Thanks & Regards,
    Divya.

    T.code :- DWDM
    u can check OLE and OFFICE INTEGRATION tree  have so many demo report
    Report :- RSOLETT1
    Edited by: Krupaji on Feb 18, 2010 2:00 PM

  • Fields only to be displayed for last line item

    I copied WESCHEINVERS3( goods receipt form) script to zxxxx and placed some fields  in Main window using Perform statement. When i am displaying the output these fields are getting displayed under each line item. but i want them to be displayed under last line item.Please suggest how can i do this.
    Thanks
    K Srinivas

    data: v_cnt1 type i, v_cnt2 type i.
    count the number line item using describe lines statement in V_cnt1
    and in the table loop count the number of item into V_cnt2.
    place the field that you want at the end of all line item in the footer of the table and put  a condition in the condition tab v_cnt1 = v_cnt2.

  • Any ideas how I can insert a pdf into word, using the insert object option. However the pdf i want to insert has text and lines annotated, but once inserted the comments don't appear????  any help would be greatly appreciated.

    Any ideas how I can insert a pdf into word, using the insert object option. However the pdf i want to insert has text and lines annotated, but once inserted the comments don't appear????  any help would be greatly appreciated.

    You will need to find a forum for MS Word since that is the software that you are trying to manipulate in this.  If you think the processing/creation of the PDF plays a role then you should ask in the forum for the software that you are using to create the PDF.
    This forum is for issue regarding downloading and installing Adobe trial products, so in any circumstance, your issue does not fit in this forum.

  • Extra spacing between words in a line when an icon is inserted

    Why do i see extra spacing between words in a line when an icon is inserted. Can someone please help me fix this issue as this is affecting readability?

    Third option is to reference the image and show it below the paragraph.
    The size of the image is in your control and if it needs more space than the text, it is going to take it.
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • Want to set view of JScrollPane to last line

    I'm creating a chat program and adding new messages to the end of JEditorPane. I want the view to always show the last message like in MSN and other chat systems. User enters text in JTextField, is formatted and appended to JeditorPane. Can anyone tell me how to do this ??

    I tried setting the JScrollBar to max but it kept missing the last line and jerked a lot. But the problem is solved by setting the caret position in JDocument to its length

  • Split Last Word into New Line

    Hello,
    Any pointers to below :-
    When entering data in column of size say 4000 the last word in the line should not be split if it cud not fit,
    if the last word does not fit then it should appear in new line and cursor should be placed at last of the word (if its last word of sentence).
    Note that multiline is set to yes and item is text item with form layout, although i have one solution but its not the best one.
    Thoughts are appreciated if there is any built in property for this or some other way?
    Forms version 10g
    Database 9i
    br
    atul

    Hello,
    This could be the starting point of an algorythme:
    SQL> set serveroutput on
    SQL>
    SQL> DECLARE
      2    LC$c    VARCHAR2(1000);
      3    v       VARCHAR2(1000);
      4    LN$MAX  PLS_INTEGER := 20 ;
      5    i       PLS_INTEGER;
      6  BEGIN
      7    LC$c := 'Here is a text to test the split of a large sentence into multiple sub fields';
      8    LOOP
      9      v := SUBSTR(LC$c, 1, LN$MAX);
    10      i := INSTR(v,' ',-1);
    11     IF i > 0 AND i < LENGTH(v) THEN
    12       v := SUBSTR(v,1,i);
    13       LC$c := SUBSTR(LC$C,i+1,1000);
    14     ELSE
    15       LC$c := SUBSTR(LC$C,LN$MAX+1,1000);
    16     END IF ;
    17     DBMS_OUTPUT.PUT_LINE('[' || v || ']');
    18     EXIT WHEN LENGTH(LC$C) = 0  OR LENGTH(LC$c) <= LN$MAX; 
    19    END LOOP;
    20    IF LENGTH(LC$c) > 0 THEN
    21      DBMS_OUTPUT.PUT_LINE('[' || LC$C || ']');
    22    END IF ;
    23  END;
    24 
    25  /
    [Here is a text to ]
    [test the split of a ]
    [large sentence into ]
    [multiple sub fields]
    Procédure PL/SQL terminée avec succès.Francois

  • Why first & last lines in each page in pdf is exported to WORD as a Header/footer?

    Similarly, when exporting a pdf file to Excel, the first and last lines in each page of the PDF do not get exported to EXCEL?

    Hi Michael,
    Installation of PDF Action is done based on this link-
    https://websmp230.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=1109054
    MII Version - 12.0.7 Build(20)
    version 1.4.5. of
    the third-party iText.jar and iTextAsian.jar, from
    http://www.lowagie.com/iText/download.html
    Thanks,
    Soumen

  • Insert  last line in ALV

    HI,
    I have :
    FORM build_fcat  USING    p_it_fcat TYPE slis_t_fieldcat_alv.
      DATA: lwa_fcat TYPE LINE OF slis_t_fieldcat_alv.
      CLEAR lwa_fcat.
      lwa_fcat-fieldname = 'NUMERO'.
      lwa_fcat-ref_tabname = 'IT_IDOC'.
      lwa_fcat-do_sum = 'X'.
      lwa_fcat-outputlen = 5.
    lwa_fcat-key = 'X'.
      APPEND lwa_fcat TO p_it_fcat.
      CLEAR lwa_fcat.
      lwa_fcat-fieldname = 'DOCNUM'.
      lwa_fcat-ref_tabname = 'EDIDC'.
    lwa_fcat-key = 'X'.
      APPEND lwa_fcat TO p_it_fcat.
    The question is ...how can I write a last line as :
    "The total numbers : "variable"  ( yellow line)
    Thanks a lot

    Hi Mpm,
      In the Output table(table to be dispayed, not the field catelog table) you
    have to add a new field 'colour'   of type slis_color(this is itself a structure with 3 fields). Pass the color values in this structure for the last row of the Internal table
    & append that row. It will display the internal table in a color.
    Ex: if itab is your final internal table, then add a new field to it
    data:   begin of  itab,
              field1...
              field2..
             color type slin_color,
             end of itab.
    After filling the data into this itab, at the end you have to fill the color field with value. for Yello color, u have to give the values like this.
       itab-color-int = 0.
       itab-color-col = 3.   'For yellow color
      append itab.
    It will dispay the last row with yellow color.
    Thanks,
    Sreenivas

  • Want to insert a XSL file's data into a column of type SYS.XMLTYPE??

    Hello Friends
    I want to insert a XSL file's data into a column of a table of type SYS.XMLTYPE. Following is the XSL which i want to add into a table please help in.....
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:stylesheet version="1.0"
         xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
         xmlns:fn="http://www.w3.org/2005/xpath-functions">
         <xsl:output method="html" encoding="UTF-8" />
         <xsl:template match="clinical_study">
         <xsl:variable name="status">
              <xsl:apply-templates select='overall_status' />
         </xsl:variable>
    <html>
    <head>
    <title>Summary</title>
    <link href="merckcancer.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
         <div id="trialtop" class="trialtop">
              <div id="trialtophead" class="trialtophead">
                   <H1>Summary</H1>
              </div>
    <!-- start of trial body-->
         <div id="trialmiddle" class="trialmiddle">
                             <span class="trialtitle1"><xsl:apply-templates select='brief_title'/></span>
                   <span class="tealbold">Official Title: </span><xsl:apply-templates select='official_title' />
                   <span class="tealbold" title="ClinicalTrials.gov Identifier">NCT Id: </span><xsl:apply-templates select='//nct_id'/>
    <span class="tealbold">Conditions: </span><xsl:for-each select="//condition[position()!=last()]"><xsl:value-of select="normalize-space(.)" /><xsl:text>, </xsl:text></xsl:for-each>
    <xsl:for-each select="//condition[position()=last()]"><xsl:value-of select="normalize-space(.)" /></xsl:for-each>
    <span class="tealbold">Phase: </span><xsl:apply-templates select='phase' />
    <span class="tealbold">Status: </span><xsl:value-of select="$status" />
    <span class="tealbold">Interventions: </span><xsl:for-each select="//intervention[position()!=last()]"><xsl:value-of select="normalize-space(intervention_type)" />: <xsl:value-of select="normalize-space(intervention_name)" /><xsl:text>, </xsl:text></xsl:for-each><xsl:for-each select="//intervention[position()=last()]"><xsl:value-of select="normalize-space(intervention_type)" />: <xsl:value-of select="normalize-space(intervention_name)" /></xsl:for-each>
    <xsl:apply-templates select='eligibility'><xsl:with-param name="type">short</xsl:with-param></xsl:apply-templates>
    </div><!-- end of middle -->
    </div><!-- end of top-->                         
    <div id="detail" class="detail">
         <div id="detailtophead" class="detailtophead">
              <H1>Details</H1>
         </div>
    <!-- end of detailtop-->
    <!-- start of detail body-->
    <div id="detailmiddle" class="detailmiddle">
    <span class="trialtitle2">Trial Description:</span>
         <span class="trialtitle4"><xsl:apply-templates select='brief_summary/textblock' /></span>
         <span class="trialtitle1">Eligibility: </span>
              <xsl:apply-templates select='eligibility'><xsl:with-param name="type">long</xsl:with-param></xsl:apply-templates>
    </div><!--end of detail middle-->
    </div><!-- end of detail top-->
    <div id="enroll" class="enroll">
    <div id="enrolltophead" class="enrolltophead">
    <H1>Enrollment</H1>
    </div>
    <!-- end of enroll top head-->
    <!-- start of enroll body-->
    <div id="enrollmiddle" class="enrollmiddle">
    <xsl:choose>
                                       <xsl:when test="$status = 'Recruiting'">
         This study has participating centers in a number of locations.
         To take the next step in learning more about participating in this clinical study please call one of these trial contacts.<p/>
         The trial contacts will know this study as <span class="tealbold"><xsl:apply-templates select='//org_study_id'/></span>
         or may know the study under the ClinicalTrials.gov identifier <span class="tealbold"><xsl:apply-templates select='//nct_id'/></span>.<p/>
         <p/>
                                       <xsl:apply-templates select='overall_contact'/>
                                       <xsl:for-each select="location">
                                            <xsl:call-template name='location'/><p/>
                                       </xsl:for-each>
                                       </xsl:when>
                                       <xsl:otherwise>
         This study is not currently Recruiting, it is <xsl:value-of select="$status" />.
                                       </xsl:otherwise>
                                       </xsl:choose>
    </div><!--end of enroll middle-->
    </div><!-- end of enroll -->
    <div id="credit" class="credit">
    <div id="credittophead" class="credittophead">
    <H1>Credits</H1>
    </div>
    <!-- end of credit top head-->
    <!-- start of credit body-->
    <div id="creditmiddle" class="creditmiddle">
                                  Information about this trial has been gathered from ClinicalTrials.gov. Please see
                                  <a>
                                       <xsl:attribute name="href" >
                                            /ctcpub/redirect.jsp?redirectURL=http://ClinicalTrials.gov
                                       </xsl:attribute>
                                       ClinicalTrials.gov
                                  </a> for more complete information.<p/>
                                  <xsl:apply-templates select='required_header/download_date'/><p/>
                                  <a>
                                       <xsl:attribute name="href" >
                                            /ctcpub/redirect.jsp?redirectURL=<xsl:apply-templates select='required_header/url'/>
                                       </xsl:attribute>
                                       <xsl:apply-templates select='required_header/link_text'/>
                                  </a> <p/>
                                  This trial data was last updated on <xsl:apply-templates select='//lastchanged_date'/><p/>
    </div><!--end of credit body-->
    </div><!--end of credit-->
    </body>
    </html>
    </xsl:template>
    <xsl:template match="brief_title">
              <span class="trialtitle"><xsl:value-of select="normalize-space(.)" /></span>
         </xsl:template>
         <xsl:template match="official_title">
              <span class="tealbold">Official Title: </span>     <xsl:value-of select="normalize-space(.)" />
         </xsl:template>
         <xsl:template match="phase">
              <span class="tealbold">Phase: </span> <xsl:value-of select="normalize-space(.)" />
         </xsl:template>
         <xsl:template match="overall_status">
              <xsl:value-of select="normalize-space(.)" />
         </xsl:template>
         <xsl:template match="eligibility">
              <xsl:param name="type" />
              <xsl:choose>
                   <xsl:when test="$type = 'short'">
                        <span class="tealbold">Eligibility: </span> <xsl:call-template name="ages">
                             <xsl:with-param name="min"><xsl:value-of select="normalize-space(minimum_age)" /></xsl:with-param>
                             <xsl:with-param name="max"><xsl:value-of select="normalize-space(maximum_age)" /></xsl:with-param>
                        </xsl:call-template>, <xsl:apply-templates select='gender' />
                   </xsl:when>
                   <xsl:when test="$type = 'long'">
                        <span class="trialtitle">Eligibility: </span>
                             <span class="tealbold">Age: </span> <xsl:call-template name="ages">
                                       <xsl:with-param name="min"><xsl:value-of select="normalize-space(minimum_age)" /></xsl:with-param>
                                       <xsl:with-param name="max"><xsl:value-of select="normalize-space(maximum_age)" /></xsl:with-param>
                                  </xsl:call-template>
                             <span class="tealbold">Genders Eligible for Study: </span> <xsl:apply-templates select='gender' />
                             <xsl:text>
                             </xsl:text>
                             <span class="tealbold">Eligibility Criteria: </span>
    <xsl:apply-templates select='criteria/textblock' />
                   </xsl:when>
                   <xsl:otherwise></xsl:otherwise>
              </xsl:choose>
         </xsl:template>
         <xsl:template match="gender">
              <xsl:choose>
                   <xsl:when test=". = 'Both'">Male or Female</xsl:when>
                   <xsl:otherwise>
                        <xsl:value-of select="normalize-space(.)" />
                   </xsl:otherwise>
              </xsl:choose>
         </xsl:template>
         <xsl:template match="overall_contact">
         <span class="trialtitle">Central Contact: </span>
              <xsl:apply-templates select='./first_name' /><xsl:text> </xsl:text>
              <xsl:apply-templates select='./middle_name' /><xsl:text> </xsl:text>
              <xsl:apply-templates select='./last_name' />
              <xsl:apply-templates select='./phone' />
              <xsl:apply-templates select='./email' />
         </xsl:template>
         <xsl:template name="ages">
              <xsl:param name="min" />
              <xsl:param name="max" />
              <xsl:choose>
                   <xsl:when test="($min != '') and ($max != '')">Between <xsl:value-of select="$min" /> and <xsl:value-of select="$max" /></xsl:when>
                   <xsl:when test="($min != '') and ($max = '')"><xsl:value-of select="$min" /> and Above</xsl:when>
                   <xsl:when test="($min = '') and ($max != '')">Under <xsl:value-of select="$max" /></xsl:when>
                   <xsl:otherwise></xsl:otherwise>
              </xsl:choose>
         </xsl:template>
         <xsl:template match="brief_summary/textblock">
              <span class="trialtitle">Trial Description: </span> <xsl:call-template name="substitute">
    <xsl:with-param name="string" select="." />
    </xsl:call-template>
         </xsl:template>
         <xsl:template name="location">
              <span class="trialtitle"><xsl:apply-templates select='.//country' /><xsl:apply-templates select='.//state' /></span>
              <xsl:apply-templates select='./facility/name' /><xsl:apply-templates select='.//city' /><xsl:apply-templates select='.//zip' /><xsl:apply-templates select='.//status' />
              <xsl:apply-templates select='./contact' />
         </xsl:template>
         <xsl:template match="contact">
              <span class="tealbold">Site Contact: </span>
              <xsl:apply-templates select='first_name' />
              <xsl:apply-templates select='middle_name' />
              <xsl:apply-templates select='last_name' />
              <xsl:apply-templates select='phone' />
              <xsl:apply-templates select='email' />
         </xsl:template>
         <xsl:template match="criteria/textblock">
              <xsl:call-template name="substitute">
         <xsl:with-param name="string" select="." />
         </xsl:call-template>     
    </xsl:template>     
         <xsl:template match="facility/name"><xsl:value-of select="normalize-space(.)" /></xsl:template>     
         <xsl:template match="country"><xsl:value-of select="normalize-space(.)" /></xsl:template>     
         <xsl:template match="city">, <xsl:value-of select="normalize-space(.)" /></xsl:template>     
         <xsl:template match="zip">, <xsl:value-of select="normalize-space(.)" /></xsl:template>     
         <xsl:template match="state">, <xsl:value-of select="normalize-space(.)" /></xsl:template>     
         <xsl:template match="status">, <xsl:value-of select="normalize-space(.)" /></xsl:template>     
         <xsl:template match="first_name"><xsl:value-of select="normalize-space(.)" />&#160;</xsl:template>     
         <xsl:template match="middle_name"><xsl:value-of select="normalize-space(.)" />&#160;</xsl:template>     
         <xsl:template match="last_name"><xsl:value-of select="normalize-space(.)" /></xsl:template>     
         <xsl:template match="phone">Phone: <xsl:value-of select="normalize-space(.)" />
    </xsl:template>     
         <xsl:template match="email"><xsl:if test='. != ""'>EMail: <xsl:value-of select="normalize-space(.)" />
    </xsl:if></xsl:template>     
    <xsl:template name="substitute">
    <xsl:param name="string" />
    <xsl:param name="from" select="'&#xA;'" />
    <xsl:param name="to">
    </xsl:param>
    <xsl:choose>
    <xsl:when test="contains($string, $from)">
    <xsl:value-of select="substring-before($string, $from)" />
    <xsl:copy-of select="$to" />
    <xsl:call-template name="substitute">
    <xsl:with-param name="string"
    select="substring-after($string, $from)" />
    <xsl:with-param name="from" select="$from" />
    <xsl:with-param name="to" select="$to" />
    </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
    <xsl:value-of select="$string" />
    </xsl:otherwise>
    </xsl:choose>
    </xsl:template>
    </xsl:stylesheet>
    Please do as early as possible..
    thanks in advance

    Hi I tried with below querry but iam getting an error message?
    SQL> Insert into temp_clob_tab
    2 SELECT XMLELEMENT("soap:Envelope",
    3 XMLATTRIBUTES ('http://www.w3.org/2001/XMLSchema-instance' as "xmlns:xsi",
    4 'http://www.w3.org/2001/XMLSchema' as "xmlns:xsd",
    5 'http://schemas.xmlsoap.org/soap/envelope/' as "xmlns:soap"),
    6 XMLELEMENT("soap:Body"),XMLELEMENT("AddListing",
    7 XMLATTRIBUTES ('http://www.christielites.com' as "xmlns" )),
    8 XMLELEMENT ( "SCOMCODE",a.SCOMCODE), XMLELEMENT ( "SLOCCODE",SLOCCODE),
    9 XMLELEMENT ( "DSTART",DSTART),XMLELEMENT ( "DEND",DEND),XMLELEMENT ( "SECODE",SECODE),
    10 XMLELEMENT ( "IAVAIL",IAVAIL),XMLELEMENT ("IOWNED",IOWNED),XMLELEMENT ("SPOSTTRANS",SPOSTTRANS))
    11 from LiteExchangeAvailablity a;
    SELECT XMLELEMENT("soap:Envelope",
    ERROR at line 2:
    ORA-00932: inconsistent datatypes: expected CLOB got -

  • How to read the last line in a txt file?

    Dear all,
    I want to read the last line in a txt file. There are thousands of lines in this file. What I want is to move the file pointer directly to the last line of the file. But I did not know how do to it. Can anybody help me out?
    Thank you very much!

    If the file is coded as ASCII or one of the encodings that maps a single byte to a char then the following class will assist you
    import java.io.*;
    import java.util.*;
    public class GetLinesFromEndOfFile
        static public class BackwardsFileInputStream extends InputStream
            public BackwardsFileInputStream(File file) throws IOException
                assert (file != null) && file.exists() && file.isFile() && file.canRead();
                raf = new RandomAccessFile(file, "r");
                currentPositionInFile = raf.length();
                currentPositionInBuffer = 0;
            public int read() throws IOException
                if (currentPositionInFile <= 0)
                    return -1;
                if (--currentPositionInBuffer < 0)
                    currentPositionInBuffer = buffer.length;
                    long startOfBlock = currentPositionInFile - buffer.length;
                    if (startOfBlock < 0)
                        currentPositionInBuffer = buffer.length + (int)startOfBlock;
                        startOfBlock = 0;
                    raf.seek(startOfBlock);
                    raf.readFully(buffer, 0, currentPositionInBuffer);
                    return read();
                currentPositionInFile--;
                return buffer[currentPositionInBuffer];
            public void close() throws IOException
                raf.close();
            private final byte[] buffer = new byte[4096];
            private final RandomAccessFile raf;
            private long currentPositionInFile;
            private int currentPositionInBuffer;
        public static List<String> head(File file, int numberOfLinesToRead) throws IOException
            return head(file, "ISO-8859-1" , numberOfLinesToRead);
        public static List<String> head(File file, String encoding, int numberOfLinesToRead) throws IOException
            assert (file != null) && file.exists() && file.isFile() && file.canRead();
            assert numberOfLinesToRead > 0;
            assert encoding != null;
            LinkedList<String> lines = new LinkedList<String>();
            BufferedReader reader= new BufferedReader(new InputStreamReader(new FileInputStream(file), encoding));
            for (String line = null; (numberOfLinesToRead-- > 0) && (line = reader.readLine()) != null;)
                lines.addLast(line);
            reader.close();
            return lines;
        public static List<String> tail(File file, int numberOfLinesToRead) throws IOException
            return tail(file, "ISO-8859-1" , numberOfLinesToRead);
        public static List<String> tail(File file, String encoding, int numberOfLinesToRead) throws IOException
            assert (file != null) && file.exists() && file.isFile() && file.canRead();
            assert numberOfLinesToRead > 0;
            assert (encoding != null) && encoding.matches("(?i)(iso-8859|ascii|us-ascii).*");
            LinkedList<String> lines = new LinkedList<String>();
            BufferedReader reader= new BufferedReader(new InputStreamReader(new BackwardsFileInputStream(file), encoding));
            for (String line = null; (numberOfLinesToRead-- > 0) && (line = reader.readLine()) != null;)
                // Reverse the order of the characters in the string
                char[] chars = line.toCharArray();
                for (int j = 0, k = chars.length - 1; j < k ; j++, k--)
                    char temp = chars[j];
                    chars[j] = chars[k];
                    chars[k]= temp;
                lines.addFirst(new String(chars));
            reader.close();
            return lines;
        public static void main(String[] args)
            try
                File file = new File("/usr/share/dict/words");
                int n = 10;
                    System.out.println("Head of " + file);
                    int index = 0;
                    for (String line : head(file, n))
                        System.out.println(++index + "\t[" + line + "]");
                    System.out.println("Tail of " + file);
                    int index = 0;
                    for (String line : tail(file, "us-ascii", n))
                        System.out.println(++index + "\t[" + line + "]");
            catch (Exception e)
                e.printStackTrace();
    }Note, the EOL characters are treated as line separators so you will probably need to read the last two lines (think about it for a bit).

  • Delete last line of a textfile without putting the whole file in memory

    Hello!
    I want to delete the last line of a text file without loading the whole text file into thememory. My problem is as follows:
    A algorithm generates output that has to be written into a text file. This happens periodically - the output goes straight into a xml file. The xml file looks like this:
    <test>
    <step>
    <time>2006-06-19 10:55:20</time>
    <result>12321</result>
    </step>
    <step>
    <time>2006-06-19 10:58:20</time>
    <result>41515</result>
    </step>
    </test>
    The XML file must be valid, so I have to delete the last line ("</test>") before I add a new <step>-section.
    Many thanks in advance
    Kind regards,
    buliwyf

    For processing in a separate tool which understands XML, then using a DTD to declare an external entity is often better - you wrap the entity in the document root element, so you can just append to the end of the file the entity references and not bother about inserting before the closing tag.
    File other app loads:
    <?xml version="1.0"?>
    <!DOCTYPE test [ <!ENTITY content SYSTEM "content.xmlfragment"> ]>
    <test>&content;</test>File content.xmlfragment which can be simple appended to:
    <step time="2006-06-19 10:55:20">12321</step>
    <step time="2007-04-09 10:55:20">12321</step>
    <step time="2008-09-26 00:03:20">12321</step>If you can't use XML to solve the problem, then you can scan backwards in the file (using random access file or file buffer) until you find a '<' character which is followed by an '/' character. You can't have CDATA after the closing tag of the document element, and comments and processing instructions have different characters following the '<'.

  • TS2570 Still cant access my computer, followed instructions to perform a safe boot and last line of script it shows: BootCacheControl: Unable to open /Var/db/BootCache.playlist:2 No such file or directory. Any idea?

    Brand new Mac Book Pro
    Purchased in Mexico's Department store Liverpool on June 20th 2012
    Purchased Memory upgade to 8Gb, on june 27th, at Apple Store Memorial City, Houston
    Upgraded memory from 4Gb to 8Gb on June 28th.
    Tried to write on my external HD (previously written on a windows based PC) with no success.
    Upon reccomendation from a Mac assistant, copied all my external HD contents into my Mac Hard drive.
    Then formatted my external HD and copied back all my information to it.
    deleted all the  information from my MacBook Pro HD.
    Attempted to repeat the same operation with another external HD, but got a message saying there was not enough epace on the computer HD (even though I have a 750Gb Hard Drive.
    Looked in the trash bin and there it was, all the information previously deleted..
    Could not empty the trash bin, although I got a message asking me to safely delete all the information from the trash bin,
    Could not get enough space released, after several attpempts the trash bin was finally emptied.
    All happy getting acquainted with my new MacBook Pro. Two days later, got a gray screen and not able to start the computer.
    Looking in to Mac support I found article http://support.apple.com/kb/TS2570 and followed instructions to perform a safe boot:
    "Perform a Safe Boot
    Simply performing the Safe Boot may resolve this issue.
    Shut down your Mac. If necessary, hold your Mac's power button for several seconds to force it to power down.
    Start your Mac, then immediately hold the Shift key. This performs a Safe Boot. Advanced tip: If you want to
    see the status of a Safe Boot as it progresses, you can hold Shift-Command-V during start up (instead of just Shift).
    Note: A Safe Boot takes longer than a typical start up because it includes a disk check and other operations.
    The following is the script that appears on the screen upon safe boot. and halt after the last line.
    AppleACPICPU:Processor Id=6 LocalAplicId=255 Disabled
    AppleACPICPU:Processor Id=7 LocalAplicId=255 Disabled
    AppleACPICPU:Processor Id=8 LocalAplicId=255 Disabled
    calling mpo_policy_init for TMSafetyNet
    Security policy loaded: Safety net for Time Machine (TMSafetyNet)
    calling mpo_policy_init for Sandbox
    Security policy loaded: Seatbelt sandbox policy (Sandbox)
    calling mpo_policy_init for Quarantine
    Security policy loaded: Quarantine Policy (Quarantine)
    Copyright (c) 1982, 1986, 1989, 1991, 1993
            The Regents of the University of California. All Rights Reserved.
    MAC Framework Succesfully initializad
    using 16384 buffer headers and 10240 cluster IO buffer headers
    IOAPIC: Version 0x20 Vextors 64:87
    ACPI: System State [SO S3 S4 S5] (S3)
    PFM64 (36cpu) 0xf10000000, 0xf0000000
    Aplconsole relocated to 0xf1000000
    PCI configuration changed (bridge=16 device=4 cardbus=0)
    [ PCI configuration end, bridges 12 devices 16 ]
    Firewire (OHCI) Lucent ID 5901 built-in now active, GUID 3c0754fffe9b2aa2; max speed s800.
    Pthread support ABORTS when sync kernel primitives misused
    com.apple.AppleFSCompressionTypeZlib kmod start
    com.apple.AppleFSCompressionTypeDataless kmod start
    com.apple.AppleFSCompressionTypeZlib load succeeded
    com.apple.AppleFSCompressionTypeDateless load succeeded
    AppleIntelCPUPowerManagementClient: ready
    BTCOEXIST off
    wl0: Broadcom BCM4331 802.11 Wireless controller
    5.100.98.75
    AppleUSBMultitouchDriver::checkStatus - received Status Packet, Payload 2: device was reinitializad
    rooting via boot-uuid from /chosen: 6E918706-FC0D-37460-A3A0-6268A51DF93B
    Waiting on <dict ID="0"><key><string ID="1">IOResources</string><key>IOResourceMatch</key><string ID="2">boot-uuid-media</string></dict>
    Got boot device = IOService:/AppleACPIPlatformExpert/PCI0@0/AppleAPIPCI/SATA@1F,2/AppleIntelPchSe riesAHCI/PRT0@0/AOAHCIDevice@0/AppleAHCIDiskDriver/IOAHCIBlock
    storageevice /IoBlockStorageDriver/TOSHIBA MK7559GSXF Media/IOGUIDPartit
    BSD root: disk0s2, major 14, minor 2
    Kernel is LP64
    com.apple.launchd 1   com.apple.launchd 1   *** launchd[1] has started up. ***
    com.apple.launchd 1   com.apple.launchd 1   *** Verbose boot, will log to /dev/console. ***
    Running fsck on the boot volume...
    ** /dev/rdisk0s2 (NO WRITE)
    ** Root file system
       Executing FSCK_HFS (version diskdev_cmds-540.1~25).
    BootCacheControl: UNable to open /Var/db/BootCache.playlist:2 No such file or directory
    launchctl:Dubious permissions on file (skipping): /Library/LaunchDaemons
    launchctl:Dubious permissions on file (skipping): /System/Library/LaunchDaemons
    Any help or suggestions on what to do next would be welcomed.
    I am in the middle of the Atlantick, stuck with a brand new, non working Apple MacBook Pro.
    Best regards
    Sergio Ramos

    Reinstalling MacOS does NOT fix the problem for me.  I'm still searching a solution !
    Bernard

  • I am making a calendar in iPhoto, picking photos from a folder, let's call it "2011 Pics," in iPhoto. After arranging all the photos and captions I decided I wanted to insert a new photo -- one that was not in "2011 Pics." So I inserted it into the folder

    Add new photo to existing calendar folder in iPhoto
    I am making a calendar in iPhoto, picking photos from a folder, let's call it "2011 Pics," in iPhoto. After arranging all the photos and captions I decided I wanted to insert a new photo -- one that was not in "2011 Pics." So I inserted it into the folder, but the picture does not show up on the scrolling menu of pictures at the left of the calendar-making page. This happened last year and in frustration I started all over again. But surely there is a way to add a new picture to a calendar that is already laid out.

    Yes, the Old Master file has a folder for each year where I find all photos from that specific year. I am attaching a screen shot of the file.
    In the meantime i have managed to download all photos (it did not download any video files though in mpg, avi, 3gp, m4v,mp4 and mov format) to a new iphoto library. Unfortunately the photos are quite mixed and often doubled up. I ma considering to purchase iphoto library which checks all duplicates in iphoto. this will save me a lot of time. What do you think?

Maybe you are looking for