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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T17:43:16+00:00 2026-05-30T17:43:16+00:00

I bump into something like this quite often. This time I have sprite sheet

  • 0

I bump into something like this quite often. This time I have sprite sheet file containing lots of lines like this:

<textureregion id="2" src="blue_ship1.png" x="778" y="791" width="64" height="65" rotated="false" trimmed="false" srcx="0" srcy="0" srcwidth="64" srcheight="65"/>

Now I would need to increment the id on each textureregion by for example 100 and then write the same xml to another file or overwrite the existing. I will have to do this again and again so I need to automate it. I can think of countless of ways to go about this. But I also want to learn something new so, here goes:

How would you complete such a task? Write a custom tool? Script? What language, library or tool would you use? What’s the least amount of lines or work you could have this sorted in?

  • 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-30T17:43:18+00:00Added an answer on May 30, 2026 at 5:43 pm

    You can use xmlstarlet to edit a xml file.
    For example: id ==> id+100

    $ xmlstarlet edit --update '/textureregion/@id' -x '.+100'  input.xml
    <?xml version="1.0"?>
    <textureregion id="102" src="blue_ship1.png" x="778" y="791" width="64" height="65" rotated="false" trimmed="false" srcx="0" srcy="0" srcwidth="64" srcheight="65"/>
    

    You can add --inplace option to edit file inplace.

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

Sidebar

Related Questions

I bump into this from time to time during class design... when I have
I actually quite often bump into these: <script type=text/javascript> var _gaq = _gaq ||
I nearly always bump into this problem in VHDL, and it probably has to
This is a problem I regularly bump into - hopefully someone can clarify to
I'm new to haskell, and from time to time I bump into a problem
I'm so close to getting this effect perfect, but I have run into a
I have come into a bump at my current company where they have an
I bump into this kind of error while running my apps. It happens occasionally
I just started to play C and I bump into this problem. Here's my
Every now and then, I bump into syntax that I've seen before, but never

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.