Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Apr 2017
    Posts
    8
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Reorganizing Tags

    Hello! I have been working on a pretty intense project with a few others and we have ran into an organizational issue. Is there an easy way to reorganize tags and their content? I need to organize this for 50,000+ lines.

    Before:
    Code:
    <game name="2010 FIFA World Cup South Africa (USA)">
    		<year>2010</year>
    		<story>Players choose a team from the 199 nations available and compete against the computer or against other players through online gaming services PlayStation Network or Xbox Live. All 10 official World Cup stadiums are available for play.</story>
    		<player>1-2 Players</player>
    		<title>2010 FIFA World Cup South Africa</title>
    		<score>3.0</score>
    		<genre>Sports</genre>
    		<dev>EA SPorts</dev>
    		<pub>Electronic Arts</pub>
    	</game>
    After:
    Code:
    <game name="2010 FIFA World Cup South Africa (USA)">
    		<title>2010 FIFA World Cup South Africa</title>
    		<year>2010</year>
    		<dev>EA SPorts</dev>
    		<pub>Electronic Arts</pub>
    		<genre>Sports</genre>
    		<score>3.0</score>
    		<player>1-2 Players</player>
    		<story>Players choose a team from the 199 nations available and compete against the computer or against other players through online gaming services PlayStation Network or Xbox Live. All 10 official World Cup stadiums are available for play.</story>
    	</game>
    Thank you.

  2. #2
    Moderator
    Join Date
    May 2002
    Location
    Hayward, CA
    Posts
    1,526
    Thanks
    1
    Thanked 24 Times in 22 Posts
    I think your best bet might be a Python script. Something like this is not best done by hand -- but is best verified by hand. :-)
    "The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
    June 30, 2001
    author, ES-Membrane project (Github Pages site)
    author, Verbosio prototype XML Editor
    author, JavaScript Developer's Dictionary
    https://alexvincent.us/blog

  3. #3
    New to the CF scene
    Join Date
    Apr 2017
    Posts
    8
    Thanks
    3
    Thanked 0 Times in 0 Posts
    I am <noob status when it comes to coding so I wouldn't know where to begin with writing a script to edit my screwed up script hah. I would think they would be a program already out there for this but searches haven't turned up much.

  4. #4
    Moderator
    Join Date
    May 2002
    Location
    Hayward, CA
    Posts
    1,526
    Thanks
    1
    Thanked 24 Times in 22 Posts
    Don't be surprised that there's no script out there for this... this is a task that's just complicated enough and rare enough that there's no point in creating a generic library for this. Seriously, take a shot at Python. I really think that's your best bet.
    "The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
    June 30, 2001
    author, ES-Membrane project (Github Pages site)
    author, Verbosio prototype XML Editor
    author, JavaScript Developer's Dictionary
    https://alexvincent.us/blog

  5. #5
    New to the CF scene
    Join Date
    Apr 2017
    Posts
    8
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Ok thanks. On to the Python section haha

  6. #6
    Super Moderator vinyl-junkie's Avatar
    Join Date
    Jun 2003
    Posts
    3,457
    Thanks
    3
    Thanked 50 Times in 50 Posts
    Thread moved to the Python forum.

    In the future, please ask a moderator to move your thread rather than duplicating it in that other forum.
    Music Around The World - Collecting tips, trade and want lists, album reviews, & more

  7. Users who have thanked vinyl-junkie for this post:

    mccorkled (Feb 27th, 2018)


 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •