<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Help for syntax highlighting]]></title><description><![CDATA[<p dir="auto">I did a little bit of research in Google and the forum, but can’t find a sollution so far.</p>
<p dir="auto">I often work with files like these:</p>
<p dir="auto">hh:mm:ss;Fehlernr.;Index;aktiv;CPU;Beschreibung;Par1;Par2;Par3;Par4;Information;<br />
76.533:22:14;21;1;0;A;“Error1”;1;0;21001;322;2;<br />
76.533:22:14;21;1;0;B;“Error1”;1;0;21001;322;4;<br />
76.533:19:51;21;1;0;A;“Error1”;1;0;21001;5337;2;<br />
76.533:19:40;21;1;0;A;“Error1”;1;0;21001;5337;2;<br />
76.533:19:21;21;1;0;A;“Error1”;1;0;21001;5337;2;<br />
76.533:18:46;31;7;0;A;“Error2”;0;0;31007;503;2;<br />
76.533:18:33;31;7;0;A;“Error2”;0;0;31007;503;2;<br />
60:12:02;26;4;0;A;“Error3”;0;0;26004;0;2;<br />
60:12:02;26;3;0;A;“Error3”;0;0;26003;2110;2;<br />
42:58:01;21;1;0;B;“Error1”;1;0;21001;322;4;<br />
42:57:20;21;1;0;A;“Error1”;1;0;21001;322;2;<br />
42:15:00;4;1;0;B;“Error4”;-32;-32000;4001;2597752;4;<br />
42:15:00;4;1;0;A;“Error4”;-32;-32000;4001;2597752;2;</p>
<p dir="auto">It would be really helpful if I could split these strings in different blocks and also colour them differently, to make it more readable.<br />
Best would be, if it would also stretch it out a little bit, that it becomes a little bit like a table.<br />
Is that possible with the UDL?</p>
<p dir="auto"><a href="https://img5.picload.org/image/pwdrolr/2015-12-14_10h53_34.png" rel="nofollow ugc">my proposal</a></p>
]]></description><link>https://community.notepad-plus-plus.org/topic/10958/help-for-syntax-highlighting</link><generator>RSS for Node</generator><lastBuildDate>Sun, 19 Apr 2026 14:11:45 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/10958.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 14 Dec 2015 09:57:28 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Help for syntax highlighting on Tue, 15 Dec 2015 16:48:09 GMT]]></title><description><![CDATA[<p dir="auto">Hello Scott,</p>
<p dir="auto">thank you for your kind words, you are right, this script, as it is, is only useful<br />
if you have a data set similar to the one Marco has.<br />
For those who want to have a more general solution replace the format_line<br />
function with this one</p>
<pre><code>def format_line(l_num):
    txt = ''
    spacer = 1
    for x in range(len(aLens) - 1):
        txt += a[x][l_num].rjust(aLens[x]+spacer)
    return txt + '\r\n'
</code></pre>
<p dir="auto">Cheers<br />
Claudia</p>
]]></description><link>https://community.notepad-plus-plus.org/post/12620</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/12620</guid><dc:creator><![CDATA[Claudia Frank]]></dc:creator><pubDate>Tue, 15 Dec 2015 16:48:09 GMT</pubDate></item><item><title><![CDATA[Reply to Help for syntax highlighting on Tue, 15 Dec 2015 12:37:44 GMT]]></title><description><![CDATA[<p dir="auto">Nice job Claudia.  I actually tried this out.  The only (slight) negative is the x==4 part, which binds it to the data set rather tightly (but that was what the user wanted).  I could see this being used to do a quick reformat on CSV data with a few tweaks.  Again, good job.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/12613</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/12613</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Tue, 15 Dec 2015 12:37:44 GMT</pubDate></item><item><title><![CDATA[Reply to Help for syntax highlighting on Mon, 14 Dec 2015 23:17:29 GMT]]></title><description><![CDATA[<p dir="auto">Hello Marco Bimbös,</p>
<p dir="auto">afaik, UDL cannot help you here.<br />
What could be done, in regards to formatting, is to use the Python Script plugin and a little script.<br />
I’have written <a href="https://notepad-plus-plus.org/community/topic/10882/feature-request-copy-line-with-number/6" rel="nofollow ugc">here</a> what needs to be done first.</p>
<p dir="auto">Regarding colorizing, it could be done but I don’t think a python script would be a good solution.<br />
From what I understand, colorizing is done when you activate a new document, repeatedly but<br />
a script runs once, normally.<br />
If you use callbacks like BUFFERACTIVATED then you need to take care that there is a logical<br />
way when the script should be executed and when not.<br />
Lastly, the addStyledText function is not that fast. Colorizing 100 lines of your provided sample<br />
takes up to 3 seconds.</p>
<p dir="auto">So, a python script could look like this</p>
<pre><code>a = &lsqb;&lsqb;] for x in editor.getLine(0).split(";")]   # create a list of lists using the first line in the doc

def ssv_to_list(cont, l_num, tot_lines):        # convert semicolon separated values to a list
    cont = cont.split(";") 
    for n in range(len(cont)): 
        a[n].append(cont[n].replace("\r\n", ""))
    
editor.forEachLine(ssv_to_list)     # well, self explaining I guess

aLens = [max([len(x) for x in a[y&rsqb;&rsqb;) for y in range(len(a))]    # find out what the biggest string is

def format_line(l_num):        # format the lines
    txt = ''
    spacer = 1     # can be used to increace space between columns
    for x in range(len(aLens) - 1):   # loop
        if x == 4 :     # your example used one left justified column
            txt += "{0:&lt;{1}}".format(' ',spacer) + a[x][l_num].ljust(aLens[x])
        else:      # right justified
            txt += a[x][l_num].rjust(aLens[x]+spacer)
    return txt + '\r\n'   # add line breaks

notepad.new()     # open a new doc
big_txt = ''

for l in range(len(a[0])):  # loop through the list of lists saved in ssv_to_list
    big_txt += format_line(l)     # create the new formatted text

editor.addText(big_txt)     # add it to editor.
</code></pre>
<p dir="auto">Cheers<br />
Claudia</p>
]]></description><link>https://community.notepad-plus-plus.org/post/12606</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/12606</guid><dc:creator><![CDATA[Claudia Frank]]></dc:creator><pubDate>Mon, 14 Dec 2015 23:17:29 GMT</pubDate></item></channel></rss>