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 6232443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:07:06+00:00 2026-05-24T10:07:06+00:00

I want to split a semicolon separated string so that I can store each

  • 0

I want to split a semicolon separated string so that I can store each individual string to be used as text between XML tags using Python. The string value looks like this:

08-26-2009;08-27-2009;08-29-2009

They are just dates stored as string values

I want to iterate through each value, store to a variable and call the variable into the following code at the end:

for element in iter:
    # Look for a tag called "Timeinfo"
    if element.tag == "timeinfo":
        tree = root.find(".//timeinfo")
        # Clear all tags below "timeinfo"
        tree.clear()
        element.append(ET.Element("mdattim"))
        child1 = ET.SubElement(tree, "sngdate")
        child2 = ET.SubElement(child1, "caldate1")
        child3 = ET.SubElement(child1, "caldate2")
        child4 = ET.SubElement(child1, "caldate3")
        child2.text = FIRST DATE VARIABLE GOES HERE
        child2.text = SECOND DATE VARIABLE GOES HERE
        child2.text = THIRD DATE VARIABLE GOES HERE

Any help is appreciated.

  • 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-05-24T10:07:07+00:00Added an answer on May 24, 2026 at 10:07 am

    Split returns a list as follows

    >>> a="08-26-2009;08-27-2009;08-29-2009"
    >>> a_split = a.split(';')
    >>> a_split
    ['08-26-2009', '08-27-2009', '08-29-2009']
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to split a string by no delimiter (effectively splitting it by each
I want to split string without using split . can anybody solve my problem
I want to split a string into each single character. Eg: Splitting : Geeta
I have a string that represents a path to a directory. I want split
I want to split a string if there is a space between words. For
I want to split a long text into smaller chunks, that will act as
I want to split a string by white spaces except if the text inside
I want split a string using PHP to get a individual date info. For
I want to split the string with '</span>' . I used the following code
I want to split a command line like string in single string parameters. How

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.