Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7714183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:03:55+00:00 2026-06-01T02:03:55+00:00

I would like to write a script which will edit multiple XML files, I

  • 0

I would like to write a script which will edit multiple XML files, I would like to have a script which will do the following;

  • Find tag “Preload” delete entire
    tag, find “Preload=?sometext?” and delete.
  • Find tag “jumpable” delete entire
    tag, find “jumpable=?sometext?” and delete.
  • Find “tween” and delete entire tag
  • Replace “slide” with “title”, remove this line
  • Find “offsety” and delete entire
    tag
  • Find “offsetx” and delete entire
    tag
  • Find “titleoffsetx” and delete
    entire tag
  • Find “presenter” and delete entire
    tag
  • Find “controls” and delete entire
    tag
  • Find “demooffsetx” and “demooffsety”
    and delete entire tag.
  • Replace “flv” with “src”, unless it is “.flv”
  • Remove type tag, eg. “type=?sometext?”

Before Script:

 <?xml version="1.0" encoding="utf-8"?>
    <presentation>
      <lesson>
        <part src="0301p.flv" breadcrumb="This is example text1">
          <cuepoints>
            <cuepoint time="0:01" preload="priority" tooltip="Demo 3.1(A)" jumpable="yes">
              <tween mode="instant" time="1" />
              <slide flv="demos/0301d1.flv" demooffsetx="-180" demooffsety="60" type="demo"></slide>
              <presenter />
              <controls />
            </cuepoint>
          </cuepoints>
         </part>
       </lesson>
    </presentation>

After Script:

<?xml version="1.0" encoding="utf-8"?>
<presentation>
  <lesson>
    <part src="0301p.flv" breadcrumb="This is example text1">
      <cuepoints>
        <cuepoint time="0:01" tooltip="Demo 3.1(A)">
          <title src="demos/0301d1.flv"></title>
        </cuepoint>
      </cuepoints>
     </part>
   </lesson>
</presentation>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T02:03:56+00:00Added an answer on June 1, 2026 at 2:03 am
    #!/usr/bin/python
    
    import re
    
    filename = 'editme.txt' #name of the file you want to edit
    
    def edit(filename):
        f = open(filename, 'rU') #reads your file
        text = f.read() #puts everything in file into a string under var text
        f.close() #closes file
        text = re.sub(r'\s[Pp]reload="\w+"', '', text) #delete preload tag
        text = re.sub(r'\s[Jj]umpable="\w+"', '', text) #delete jumpable tag
        text = re.sub(r'<tween.+>\s+', '', text) #delete tween tag
        text = re.sub(r'slide', 'title', text) #replaces slide with title tag
        text = re.sub(r'\s\w+offset\w+=".+"', '', text) #delete offset/type tags
        text = re.sub(r'<presenter.+>\s+', '', text) #deletes presenter tag
        text = re.sub(r'\s+<controls.+>', '', text) #deletes controls tag
        text = re.sub(r'<title flv', '<title src', text) #replaces flv with src in title tag
        f = open(filename, 'w') 
        f.write(text) #replaces all text in file with the edited text
        f.close()
    
    edit(filename)
    

    This simple python script should output what you want.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to write Python script, which will get i.e. 100 news/texts from
Is Delphi have any ability to write script of IDE actions? I would like
I would like to write a java script which: When the page loads takes
I am trying to find a way to write a script which will check
i'm trying to write a script which would process certain files. The data are
I would like to write an if statement that will do something base on
I want to write a PHP script which will first detect URL's and see
Let´s say I have two branches, default and mybranch, I would like to write
Currently, I have a script which does the following. If I have text file
Have been trying to write an awk script which processes a log file, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.