View previous topic :: View next topic |
Author |
Message |
Classicus Advanced Cheater Reputation: 0
Joined: 22 Dec 2011 Posts: 51
|
Posted: Tue Jun 28, 2016 10:40 pm Post subject: Sorting table |
|
|
I tried searching this topic but couldn't find what I'm looking for. I have a large table with a lot of groups, scripts, addresses, etc...
I accidentally clicked on "description" near the top which sorted everything. Is there any way to undo that sorting?
|
|
Back to top |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Tue Jun 28, 2016 10:50 pm Post subject: |
|
|
Close and reopen the table.
Or you can try sorting it by the creation order...
http://www.freeformatter.com/xsl-transformer.html
Open the table in NotePad and paste that as XML Input.
Paste the following as XSL Input.
Code: | <?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="CheatTable/CheatEntries">
<xsl:copy>
<xsl:for-each select="CheatEntry">
<xsl:sort select="ID"/>
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:for-each>
</xsl:copy>
</xsl:template>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet> |
|
|
Back to top |
|
|
Classicus Advanced Cheater Reputation: 0
Joined: 22 Dec 2011 Posts: 51
|
Posted: Wed Jun 29, 2016 12:04 am Post subject: |
|
|
The issue with closing and reopening is I made a lot of changes and saved, then realized sorting was all screwed up afterwards. I tried the XML formatter but there are errors with opening the table after using it, such as white space not allowed here on line 16117, then I fix that and another error on some line a few thousand down, and repeat, etc...
I might just accept the new formatting and re-position things along the way. Thanks!
edit: I sorted by address and almost everything fell into it's proper place. Only the groups and scripts need some shifting which isn't too bad since there are only a handful of those. The addresses under those groups are abundant but thanks to their original order being based on address order, this basically fixed my issue.
|
|
Back to top |
|
|
mgr.inz.Player I post too much Reputation: 218
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
|
Back to top |
|
|
Classicus Advanced Cheater Reputation: 0
Joined: 22 Dec 2011 Posts: 51
|
Posted: Thu Jun 30, 2016 2:51 am Post subject: |
|
|
Thanks mgr.inz.Player! Just tested it in CE 6.5 and it works great. Sorting has caused issues for me from time to time. I had previously looked for such a feature under options but never thought it was possible to implement with an autorun lua script.
|
|
Back to top |
|
|
|