Forum Replies Created

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • in reply to: Replace text in multimple files ONLY in a specific XML tag #25436
    Simon McMahon
    Participant

    Ahh, yes Stefan, working from the end of the line is a good idea. Thank you very much.

    in reply to: Replace in Files – multiple times #20689
    Simon McMahon
    Participant

    Hi Yataka, I have another replace in files problem. I tried to record a macro to do the following

    Replace this line:
    <xsl:output method=”html” encoding=”UTF-8″ indent=”yes” doctype-public=”-//W3C//DTD XHTML 1.0 Transitional//EN” doctype-system=”http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”/&gt;

    With this line:
    <xsl:output method=”xml” encoding=”UTF-8″ indent=”yes” />

    In over 100 .XSL files.

    I thought given the ” quotes in the strings I would need to use a double quote to refer to each string, but this has failed.

    Can you suggest the correct macro? My not working example is below. I can send you some sample .XSL files if you need them to test,

    Thanks, Simon

    // Replace in Files – XML header line (JavaScript)
    editor.ReplaceInFiles( “”<xsl:output method=”html” encoding=”UTF-8″ indent=”yes” doctype-public=”-//W3C//DTD XHTML 1.0 Transitional//EN” doctype-system=”http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”/>”&#8221;,””<xsl:output method=”xml” encoding=”UTF-8″ indent=”yes” />””, “C:\\temp\\*.xsl”, eeReplaceBackup, eeEncodingSystemDefault, “*.bak”, “C:\\xmlBackup” );

    in reply to: Replace in Files – multiple times #19933
    Simon McMahon
    Participant

    Thanks Yutaka, that has worked. My string is now by way of example:
    editor.ReplaceInFiles( “<“,”<“, “C:\\temp\\*.xml”, eeReplaceBackup, eeEncodingSystemDefault, “*.bak”, “C:\\xmlBackup” );
    editor.ReplaceInFiles( “>”,”>”, “C:\\temp\\*.xml”, eeReplaceBackup, eeEncodingSystemDefault, “*.bak”, “C:\\xmlBackup” );
    editor.ReplaceInFiles( “&”,”&”, “C:\\temp\\*.xml”, eeReplaceBackup, eeEncodingSystemDefault, “*.bak”, “C:\\xmlBackup” );

    in reply to: Replace in Files – multiple times #19931
    Simon McMahon
    Participant

    Hi I have emailed the files as requested.
    xmlFilesForChange.zip
    fix-special-characters-in-files(original2).zip

    in reply to: Replace in Files – multiple times #19927
    Simon McMahon
    Participant

    Hi there, I have a problem with my existing Macro not working for replace in files across 80+ XML files. Here is a sample of the current macro which fails to run.

    editor.ReplaceInFiles( “<“,”<“, “*.xml”, eeReplaceBackup, eeEncodingSystemDefault, “*.bak”, “C:\\xmlBackup” );
    editor.ReplaceInFiles( “>”,”>”, “*.xml”, eeReplaceBackup, eeEncodingSystemDefault, “*.bak”, “C:\\xmlBackup” );
    editor.ReplaceInFiles( “&”,”&”, “*.xml”, eeReplaceBackup, eeEncodingSystemDefault, “*.bak”, “C:\\xmlBackup” );
    editor.ReplaceInFiles( “"”,”\x22″, “*.xml”, eeReplaceBackup, eeEncodingSystemDefault, “*.bak”, “C:\\xmlBackup” );
    editor.ReplaceInFiles( “'”,”\x27″, “*.xml”, eeReplaceBackup, eeEncodingSystemDefault, “*.bak”, “C:\\xmlBackup” );
    editor.ReplaceInFiles( “–”,”-“, “*.xml”, eeReplaceBackup, eeEncodingSystemDefault, “*.bak”, “C:\\xmlBackup” );
    editor.ReplaceInFiles( “&”,”and”, “*.xml”, eeReplaceBackup, eeEncodingSystemDefault, “*.bak”, “C:\\xmlBackup” );
    editor.ReplaceInFiles( “ ”,” “, “*.xml”, eeReplaceBackup, eeEncodingSystemDefault, “*.bak”, “C:\\xmlBackup” );
    editor.ReplaceInFiles( “&”,”and”, “*.xml”, eeReplaceBackup, eeEncodingSystemDefault, “*.bak”, “C:\\xmlBackup” );
    editor.ReplaceInFiles( “<![CDATA[“,””, “*.xml”, eeReplaceBackup, eeEncodingSystemDefault, “*.bak”, “C:\\xmlBackup” );
    editor.ReplaceInFiles( “]]>”,””, “*.xml”, eeReplaceBackup, eeEncodingSystemDefault, “*.bak”, “C:\\xmlBackup” );
    editor.ReplaceInFiles( “<category></category>”,”<category>Event XML Upload</category>”, “*.xml”, eeReplaceBackup, eeEncodingSystemDefault, “*.bak”, “C:\\xmlBackup” );
    editor.ReplaceInFiles( “]]>”,””, “*.xml”, eeReplaceBackup, eeEncodingSystemDefault, “*.bak”, “C:\\xmlBackup” );
    editor.ReplaceInFiles( “&”,”and”, “*.xml”, eeReplaceBackup, eeEncodingSystemDefault, “*.bak”, “C:\\xmlBackup” );
    editor.ReplaceInFiles( “#8216;”,”‘”, “*.xml”, eeReplaceBackup, eeEncodingSystemDefault, “*.bak”, “C:\\xmlBackup” );
    editor.ReplaceInFiles( “#8217;”,”‘”, “*.xml”, eeReplaceBackup, eeEncodingSystemDefault, “*.bak”, “C:\\xmlBackup” );
    editor.ReplaceInFiles( “#8230;”,”…”, “*.xml”, eeReplaceBackup, eeEncodingSystemDefault, “*.bak”, “C:\\xmlBackup” );
    editor.ReplaceInFiles( “#8220;”,”‘”, “*.xml”, eeReplaceBackup, eeEncodingSystemDefault, “*.bak”, “C:\\xmlBackup” );
    editor.ReplaceInFiles( “#8221;”,”‘”, “*.xml”, eeReplaceBackup, eeEncodingSystemDefault, “*.bak”, “C:\\xmlBackup” );
    editor.ReplaceInFiles( “#8212;”,”-“, “*.xml”, eeReplaceBackup, eeEncodingSystemDefault, “*.bak”, “C:\\xmlBackup” );
    editor.ReplaceInFiles( “#39;”,”‘”, “*.xml”, eeReplaceBackup, eeEncodingSystemDefault, “*.bak”, “C:\\xmlBackup” );
    editor.ReplaceInFiles( “and'”,”‘”, “*.xml”, eeReplaceBackup, eeEncodingSystemDefault, “*.bak”, “C:\\xmlBackup” );
    editor.ReplaceInFiles( “<p>andnbsp;</p>”,””, “*.xml”, eeReplaceBackup, eeEncodingSystemDefault, “*.bak”, “C:\\xmlBackup” );
    editor.ReplaceInFiles( “<organisation><p>”,”<organisation>”, “*.xml”, eeReplaceBackup, eeEncodingSystemDefault, “*.bak”, “C:\\xmlBackup” );
    editor.ReplaceInFiles( “</p></organisation>”,”</organisation>”, “*.xml”, eeReplaceBackup, eeEncodingSystemDefault, “*.bak”, “C:\\xmlBackup” );

    Can you suggest correct syntax so it will run on version 14.9.3

Viewing 5 posts - 1 through 5 (of 5 total)