<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[QElectroTech — Force renumber all items (autonumbering)]]></title>
		<link>https://qelectrotech.org/forum/viewtopic.php?id=1180</link>
		<atom:link href="https://qelectrotech.org/forum/extern.php?action=feed&amp;tid=1180&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Force renumber all items (autonumbering).]]></description>
		<lastBuildDate>Fri, 04 Oct 2024 10:45:02 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Force renumber all items (autonumbering)]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=20408#p20408</link>
			<description><![CDATA[<p> Hi All, i am brand new to this software but i am very excited. I have noticed that there is a auto numbering function built into version 0.9 but when i try to apply it nothing changes. We want to be able to recalculate the numbers of all elements with a script or via the software. The reason is we dont redraw all our projects from scratch, we always modify older projects to save time, The idea is when you have added and deleted elements that you can say recalculate somehow and all the elements gets fresh numbers, Without this capability we will not be able to use this because renaming every element manually is just too much work. I really hope someone can point us in the right direction </p>]]></description>
			<author><![CDATA[null@example.com (johan.vanwyk)]]></author>
			<pubDate>Fri, 04 Oct 2024 10:45:02 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=20408#p20408</guid>
		</item>
		<item>
			<title><![CDATA[Re: Force renumber all items (autonumbering)]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=14816#p14816</link>
			<description><![CDATA[<p> Hi Paulius,</p><p>From what I saw your old elements don´t have the same prefix as the new elements (KM1, KM2, KM3). The script posted previously won&#039;t renumber those old elements as they do not have the same prefix. I have been working on the script, adding some functionalities, I will post about this later, but for the time this might help you.</p><p>I made an example emulating what you posted. I relabeled the elements (OLD, VERYOLD). The element&#039;s name is:embed://import/10_electric/fabricantes/controladores_visualizadores/pixsys/atr142-abc.elmt and the prefix I want to use is KM.</p><p>Usage:<br /></p><div class="codebox"><pre><code>python xmlrenumber.py -i TEST.qet -o TEST_vr.qet -s8 -e atr142-abc.elmt -p KM</code></pre></div><p>This will number the elements with the name &#039;atr142-abc.elmt&#039; with a prefix different to KM. This only works with the formaula text+number.</p><p>Notice they won´t be numbered with the elements in the order of position x,y. If you want to organize them, then use: python xmlrenumber.py -i TEST_vr.qet -o TEST_vr.qet -s4</p><p>You might need to install lxml to run the script <a href="https://lxml.de/installation.html">https://lxml.de/installation.html</a></p><p>Hope this helps. </p>]]></description>
			<author><![CDATA[null@example.com (ksgordillot)]]></author>
			<pubDate>Mon, 19 Apr 2021 18:14:48 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=14816#p14816</guid>
		</item>
		<item>
			<title><![CDATA[Re: Force renumber all items (autonumbering)]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=14810#p14810</link>
			<description><![CDATA[<p> Hi,</p><p>I prepared example. please find attachment.</p><p>Yes old elements label was written in elements information/label.</p><p>With new element KM1; 2; 3 all works fine.</p><p>But how to apply autonumbering for old.</p><p>Sorry for dumb questions. </p>]]></description>
			<author><![CDATA[null@example.com (paulius)]]></author>
			<pubDate>Sun, 18 Apr 2021 09:49:18 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=14810#p14810</guid>
		</item>
		<item>
			<title><![CDATA[Re: Force renumber all items (autonumbering)]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=14804#p14804</link>
			<description><![CDATA[<p> Hi Paulius,</p><p>Do the old elements have any labels already? or are they without label? </p>]]></description>
			<author><![CDATA[null@example.com (ksgordillot)]]></author>
			<pubDate>Fri, 16 Apr 2021 12:29:36 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=14804#p14804</guid>
		</item>
		<item>
			<title><![CDATA[Re: Force renumber all items (autonumbering)]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=14803#p14803</link>
			<description><![CDATA[<p> Hello gents,</p><p>Can someone tell me about autonumbering of old elements? At first I put labels manualy. But then find out autonumbering. For new elements its working perfectly. But I want to go from first folio and rename with autonumbering.</p><p>Thanks. </p>]]></description>
			<author><![CDATA[null@example.com (paulius)]]></author>
			<pubDate>Fri, 16 Apr 2021 05:11:05 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=14803#p14803</guid>
		</item>
		<item>
			<title><![CDATA[Re: Force renumber all items (autonumbering)]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=14549#p14549</link>
			<description><![CDATA[<p> Hi, </p><p>Thank you for your script Jan, it was definitely useful for me. I modified it a little bit according to my needs, I have numbering configurations with text with more than 1 letter, and the prefix was different (only the first letter of the label). This script renumbers all the elements in the project that have a label in the element information, overlooking the prefix. So the elements are organized according to the label, also is only for units, but I think it can be easily modified for tens and hundreds. Also, it changes the sequential number, the element information, and the dynamic text, so when you export the components list the label and the formula are the same (if it had a formula in the beginning).</p><p>Usage</p><p>python xmlparse_unit.py -i xmltest.qet -o xmltest_renumbered.qet</p><p>I hope somebody finds this useful as well.</p><p>Regards,</p><p>Karen </p>]]></description>
			<author><![CDATA[null@example.com (ksgordillot)]]></author>
			<pubDate>Fri, 12 Mar 2021 14:07:40 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=14549#p14549</guid>
		</item>
		<item>
			<title><![CDATA[Re: Force renumber all items (autonumbering)]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=7792#p7792</link>
			<description><![CDATA[<p> Wow, nice Jan. <img src="https://qelectrotech.org/forum/img/smilies/nomicons/smile.png" width="20" alt="nomicons/smile" /></p><p><span class="postimg"><img src="https://download.qelectrotech.org/qet/forum_img/xmlpython.png" alt="https://download.qelectrotech.org/qet/forum_img/xmlpython.png" /></span> </p>]]></description>
			<author><![CDATA[null@example.com (scorpio810)]]></author>
			<pubDate>Sun, 18 Feb 2018 18:47:51 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=7792#p7792</guid>
		</item>
		<item>
			<title><![CDATA[Re: Force renumber all items (autonumbering)]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=7791#p7791</link>
			<description><![CDATA[<p> Hi,<br />so I did not really gave up and tried a XML framework for python - as parse whole XML in awk is insane. (It is installed in my OpenSuse as default, hope other distributions have it too).</p><p>Usage</p><div class="codebox"><pre><code>python xmlparse.py -i xmltest.qet -o xmltest_renumbered.qet</code></pre></div><p>and result should be renumbered all &quot;ten&quot;s and &quot;hundred&quot;s according to the prefix and position in schematics from top down and left right manner. Items without these tags are ignored.</p><p>It actually does only this and nothing else, it does not care at all about any formulas etc.</p><p>This is definitely enough for me now - hope somebody find it also useful and perhaps add additional functionality as I really do not have needed skills in Python.</p><p>Cheers,<br />Jan. </p>]]></description>
			<author><![CDATA[null@example.com (yenda)]]></author>
			<pubDate>Sun, 18 Feb 2018 18:33:22 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=7791#p7791</guid>
		</item>
		<item>
			<title><![CDATA[Re: Force renumber all items (autonumbering)]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=7786#p7786</link>
			<description><![CDATA[<p> I understand that it needs a lot of work, thank you for sharing your script, maybe someone will one day be interested in this challenge..<br />In my case at my work I never use autonumbering. <br />I only refresh old projects and is always a hard work to refresh and re draw old schemes on modified installations. </p>]]></description>
			<author><![CDATA[null@example.com (scorpio810)]]></author>
			<pubDate>Sun, 18 Feb 2018 13:27:36 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=7786#p7786</guid>
		</item>
		<item>
			<title><![CDATA[Re: Force renumber all items (autonumbering)]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=7785#p7785</link>
			<description><![CDATA[<p> OK, your awk is in different location... then you can use it as before, with direct awk call. <img src="https://qelectrotech.org/forum/img/smilies/nomicons/smile.png" width="20" alt="nomicons/smile" /></p><p>I&#039;m thinking about solving the issue of numbering from left to right + from up to down and it would need me to parse whole xml and do really, really a lot of stuff... I&#039;m afraid this is no way, no quick solution for the moment. Giving up <img src="https://qelectrotech.org/forum/img/smilies/nomicons/sad.png" width="20" alt="nomicons/sad" /> </p><p>Regards</p><p>Jan. </p>]]></description>
			<author><![CDATA[null@example.com (yenda)]]></author>
			<pubDate>Sun, 18 Feb 2018 13:21:44 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=7785#p7785</guid>
		</item>
		<item>
			<title><![CDATA[Re: Force renumber all items (autonumbering)]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=7784#p7784</link>
			<description><![CDATA[<p> </p><div class="quotebox"><cite>yenda wrote:</cite><blockquote><p>Hi,</p><div class="codebox"><pre><code>./renumber_v4.awk contacts.qet &gt; contacts_renumbered.qet</code></pre></div></blockquote></div><p>Depend on distro packaging..</p><p><span style="color: #54ff54"><strong>laurent@debian</strong></span><span style="color: #000000">:</span><span style="color: #5454ff"><strong>~/Desktop</strong></span><span style="color: #000000">$ ./renumber_v4.awk 1.qet &gt; test_awk.qet</span><br />bash: ./renumber_v4.awk : /bin/awk : mauvais interpréteur: Aucun fichier ou dossier de ce type<br />[14:13:37] <span style="color: #54ff54"><strong>laurent@debian</strong></span><span style="color: #000000">:</span><span style="color: #5454ff"><strong>~/Desktop</strong></span><span style="color: #000000">$ awk -f renumber_v4.awk 1.qet &gt; test_awk.qet  </span><br />[14:14:33] <span style="color: #54ff54"><strong>laurent@debian</strong></span><span style="color: #000000">:</span><span style="color: #5454ff"><strong>~/Desktop</strong></span><span style="color: #000000">$ whereis awk</span><br />awk: /usr/bin/awk /usr/lib/x86_64-linux-gnu/awk /usr/share/awk /usr/share/man/man1/awk.1.gz<br />[14:15:25] <span style="color: #54ff54"><strong>laurent@debian</strong></span><span style="color: #000000">:</span><span style="color: #5454ff"><strong>~/Desktop</strong></span><span style="color: #000000">$ whereis gawk</span><br />gawk: /usr/bin/gawk /usr/lib/x86_64-linux-gnu/gawk /usr/share/man/man1/gawk.1.gz<br />[14:15:46] <span style="color: #54ff54"><strong>laurent@debian</strong></span><span style="color: #000000">:</span><span style="color: #5454ff"><strong>~/Desktop</strong></span><span style="color: #000000">$ whereis original-awk</span><br />original-awk: /usr/bin/original-awk /usr/share/man/man1/original-awk.1.gz </p>]]></description>
			<author><![CDATA[null@example.com (scorpio810)]]></author>
			<pubDate>Sun, 18 Feb 2018 13:16:50 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=7784#p7784</guid>
		</item>
		<item>
			<title><![CDATA[Re: Force renumber all items (autonumbering)]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=7783#p7783</link>
			<description><![CDATA[<p> The most difficult is to respect a sequence of re numbering left to right and from top to bottom.</p><p><span class="postimg"><img src="https://download.qelectrotech.org/qet/forum_img/awk2.png" alt="https://download.qelectrotech.org/qet/forum_img/awk2.png" /></span> </p>]]></description>
			<author><![CDATA[null@example.com (scorpio810)]]></author>
			<pubDate>Sun, 18 Feb 2018 13:10:53 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=7783#p7783</guid>
		</item>
		<item>
			<title><![CDATA[Re: Force renumber all items (autonumbering)]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=7782#p7782</link>
			<description><![CDATA[<p> Hi,<br />yes, it is going to be VERY complicated if you like catch every possible rule. This should be done inside the Qelectrotech and not externally (my opinion).<br />I did play with the script little more and implemented functionality to renumber items according to the &quot;prefix&quot;, so with each prefix it starts a new numbering (new seqt_1 sequence from 1 up to items with the same prefix).</p><div class="codebox"><pre><code>./renumber_v4.awk contacts.qet &gt; contacts_renumbered.qet</code></pre></div><p>The problems:<br />- it can go wrong if you have different formula than &quot;%id%prefix%seqt_1&quot;<br />- if you have device without prefix, it will not work (can be easily fixed but anyway, it is not a solution)<br />- the numbering increases the item value as it flow through the xml file. So it seems to be a little random... and I have no idea how to fix this.</p><p>For my needs I can use as it is... but not really helpful in other cases. The script would be really difficult to implement if you like to catch every possibility.</p><p>Regards</p><p>Jan. </p>]]></description>
			<author><![CDATA[null@example.com (yenda)]]></author>
			<pubDate>Sun, 18 Feb 2018 12:49:15 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=7782#p7782</guid>
		</item>
		<item>
			<title><![CDATA[Re: Force renumber all items (autonumbering)]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=7781#p7781</link>
			<description><![CDATA[<p> It&#039;s a good start, but it&#039;s going to be very complicated if you want to renumerate an entire project following rules, I think. <img src="https://qelectrotech.org/forum/img/smilies/nomicons/smile.png" width="20" alt="nomicons/smile" /> </p>]]></description>
			<author><![CDATA[null@example.com (scorpio810)]]></author>
			<pubDate>Sun, 18 Feb 2018 12:24:05 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=7781#p7781</guid>
		</item>
		<item>
			<title><![CDATA[Re: Force renumber all items (autonumbering)]]></title>
			<link>https://qelectrotech.org/forum/viewtopic.php?pid=7780#p7780</link>
			<description><![CDATA[<p> </p><div class="codebox"><pre><code>awk -f renumber_v3.awk 1.qet &gt; test_awk.qet</code></pre></div><p><span class="postimg"><img src="https://download.qelectrotech.org/qet/forum_img/1.png" alt="https://download.qelectrotech.org/qet/forum_img/1.png" /></span><br /><span class="postimg"><img src="https://download.qelectrotech.org/qet/forum_img/awk.png" alt="https://download.qelectrotech.org/qet/forum_img/awk.png" /></span> </p>]]></description>
			<author><![CDATA[null@example.com (scorpio810)]]></author>
			<pubDate>Sun, 18 Feb 2018 11:52:44 +0000</pubDate>
			<guid>https://qelectrotech.org/forum/viewtopic.php?pid=7780#p7780</guid>
		</item>
	</channel>
</rss>
