topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Saturday December 6, 2025, 8:26 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Recent Posts

Pages: prev1 ... 27 28 29 30 31 [32] 33 34 35 36 37 ... 146next
776
Post New Requests Here / Re: Help to install a java script or similar CRGREP
« Last post by Ath on March 03, 2017, 02:14 PM »
Can't be that hard, downloading now (but it's slow...), hang on
777
Living Room / Re: What books are you reading?
« Last post by Ath on March 01, 2017, 01:09 AM »
Finished The Phoenix Project just a couple of days ago

Screenshot - 01-03-2017 , 08_06_37.png

Still planning to read The Mythical Man-Month, it's hiding somewhere in the office here, just have to recover it :tellme:
778
Official Announcements / Re: Forum Upgraded August 30, 2015 - Report issues here
« Last post by Ath on February 23, 2017, 09:56 AM »
Might it be an extension?
Just tried Firefox with extensions disabled, but the result is the same :-\
I'd call it a bug, but hey, who am I to judge this 'feature' ;D
779
Clipboard Help+Spell / Re: CHS not copying text from column of cells
« Last post by Ath on February 22, 2017, 07:33 AM »
Just guessing: The list of columns is an object, not text or rtf?
780
Official Announcements / Re: Forum Upgraded August 30, 2015 - Report issues here
« Last post by Ath on February 21, 2017, 01:28 AM »
It may be a browser issue -- what browser are you using? Have you tried chrome?
Darn, it is indeed most likely browser related, tried before with Firefox and Pale Moon (a FF derivate), but in Chrome there is no such issue :o

In IE it is even worse, there it includes the line numbers and inserts an extra blank line between each line :'( (but I only use IE for an internal work-site that uses ActiveX stuff, phew)

Examples:
Screenshot - 21-02-2017 , 08_24_02.png

I'll have to take my complaints elsewhere, I guess :-[ ;D
Thanks for the feedback, didn't expect that.
781
General Software Discussion / Re: tool to check if TIFF files compressed ?
« Last post by Ath on February 20, 2017, 03:15 PM »
I also want this  :)

download it ?
It sounds like we have attracted a troll >:(
782
Official Announcements / Re: Forum Upgraded August 30, 2015 - Report issues here
« Last post by Ath on February 20, 2017, 02:22 PM »
I think Contro found an issue in the [ code=language ] forum-tag. When pressing the 'Select' link and copying the content to the clipboard, each line is prefixed with 4 spaces, the space the line numbering takes in the view. When using no language in the code tag, all seems to work just fine.
I'd qualify this as a bug in (probably) the plugin that handles this layout task for the forum.

Test it here:
A multi-line block of text hidden
in a code tag without
a language applied to it
Code: AutoIt [Select]
  1. Another multi-line snippet of text
  2. in a code=autoit tag, it shows line-
  3. numbering and highlighting for any recognized keywords
  4. is shown

Using the select link on the second code block and pressing Ctrl-C to copy to the clipboard, then pasting in an editor, each line has 4 excess spaces in front of it. :huh:

This shouldn't be an issue for most languages, but for Python it is, and for the other languages it is a nuisance, not quite easy to fix for non-programmers as they don't understand why it isn't working as expected...
783
Post New Requests Here / Re: Sort lines of a txt file by lenght of the string
« Last post by Ath on February 20, 2017, 12:41 PM »
Did you re-try the TED Notepad procedure already?

Perhaps very long lines and wrapped text cause it to fail?
That's unlikely, TED Notepad supports very long lines (over 1 million characters), and isn't fooled by wrapped lines either.
784
Post New Requests Here / Re: Sort lines of a txt file by lenght of the string
« Last post by Ath on February 20, 2017, 01:48 AM »
Did you re-try the TED Notepad procedure already? I'd be interested to hear if you got that working. Eventually that's the simplest procedure, while keeping your files local.

I think very interesting to load a python script.
It's new for me.

Can I try again ?
Unfortunately, Python is an indentation sensitive language, so normal lines need to start in column 1, and anything grouped in conditional or for loops needs to be indented. (It lacks the curly braces from C/Java style languages, or the begin/end from Pascal.) Copying from the forum inserts the undesired white-space :(
It should work when you remove the excess white-space from the python script, only 3 lines should be indented, all other lines need to start at column 1. (How to un-indent: Select all indented lines, press Shift-Tab once)
I'll update the procedure, (or mouser could fix the forum to not insert white-space when copying text from a code block... :tellme:)
785
Post New Requests Here / Re: Sort lines of a txt file by lenght of the string
« Last post by Ath on February 19, 2017, 02:36 PM »
If you apply the description of my TED Notepad procedure, copy/pasting the 'Output mask' values from here, you should be fine, I think I see at least 3 typos in your first screenshot, and then it only gets worse from there...
786
Post New Requests Here / Re: Sort lines of a txt file by lenght of the string
« Last post by Ath on February 19, 2017, 08:51 AM »
Though it worked fine for me, using TED Notepad, I wanted to resolve this one using Notepad++ too.
It won't be possible to use the, quite limited, macro feature of Npp, so I used a scripting plugin: Notepad++ Python Script

[One time only]
- Install the Notepad++ Python Script plugin, using the MSI installer, not using the plugin manager. It can be downloaded from here. Close Notepad++ before the installer is run.
- Open Notepad++
- Check if Python Script is working correctly by opening the console: Plugins/Python Script/Show Console, en verifying that it shows the Python version, something like this:
Python 2.7.6-notepad++ r2 (default, Apr 21 2014, 19:26:54) [MSC v.1600 32 bit (Intel)]
Initialisation took 125ms
Ready.
- Choose Plugins/Python Script/New Script, type a filename: sort-by-length.py, and press Save. The file is created and opened in Notepad++
- Paste this script into sort-by-length.py:
Code: Python [Select]
  1. # Ath: Found this in the notepad-plus forum on sourceforge.net, modified as suggested in the comments there
  2. editor.beginUndoAction()
  3. if editor.getSelText(): # grab the lines
  4.     linee = editor.getSelText().splitlines()
  5. else:
  6.     linee = editor.getText().splitlines()
  7. sorted_lines=sorted(linee,key=lambda x:len(x)) # add parameter reverse=True, to sort descending by length
  8. editor.clearAll() # wipe lines in editor
  9. for line in sorted_lines:
  10.     print(line) # put all lines back in the editor
  11. editor.endUndoAction()
- Make sure the code is not indented (so each line starting on column 1) except for lines 4, 6 and 10 as they must be indented.
- Save the file
- The script should now be available in the menu Plugins/Python Script/Scripts/ (don't select it, it will execute immediately!)

[Process a file]
- Open the file to sort, and make sure it is the selected file
- Select Plugins/Python Script/Scripts/sort-by-length
- The file will be emptied and filled with all lines again, shortest first (or longest first if reversed=True was set). It may take some time, as Python (Script) doesn't seem very fast in this configuration
- If an error occurs during processing, it will be shown in the Python Script console (see above how to open that)
- Save the file
Done :D

Edit: Added sentence about the code needing to be at column 1
787
Screenshot Captor / Re: Add Border To Image Isn't Adding a Border :o(
« Last post by Ath on February 19, 2017, 07:33 AM »
Did you set the Post capture options to apply it automatically?

Screenshot - 19-02-2017 , 14_28_17.png

Another way to apply the Quick Border would be to use "SpecialFX2/Border around image/Simple border around image - inside", (or -outside)
788
Screenshot Captor / Re: capturing a specific area.
« Last post by Ath on February 19, 2017, 07:21 AM »
Or use MiniCap, specifically with the "-captureregion left top right bottom" and "-save ..." parameters. Then, added as a desktop shortcut with a global hotkey, a screenshot would be a single hotkey-press away.
789
Post New Requests Here / Re: Manipulate lines in a txt file
« Last post by Ath on February 19, 2017, 07:14 AM »
Well, wouldn't it be a good example?  What does he want done if this happens?
Yep, it would be. No answer yet :(
790
Post New Requests Here / Re: Sort lines of a txt file by lenght of the string
« Last post by Ath on February 19, 2017, 06:51 AM »
I have tried. But I think i am doing something wrong.
Uhm, did you retype the Output mask values, or copy/paste from this page?
Copy/paste is the least error-prone, especially as the first sequence is: percent, plus, lowercase-L, zero, vertical bar, percent, zero
791
Post New Requests Here / Re: Sort lines of a txt file by lenght of the string
« Last post by Ath on February 19, 2017, 06:43 AM »
Simple don't get results .
Huh? You do select all text (Ctrl-A) before running any of the tools? It makes working with the preview of "Tools/Lines/Columns, Numbers" possible, so you should see a preview while entering the Output mask.

You can attach a sample file here, or PM me for my e-mail, and I'll verify if the file is causing the trouble. Current TED Notepad seems to have issues with UTF-8 files without a BOM, and you might have such a file, but you should be able to use File/Re-open as UTF-8 and it could resolve your issue.
792
Post New Requests Here / Re: Sort lines of a txt file by lenght of the string
« Last post by Ath on February 18, 2017, 02:23 PM »
Give TED Notepad a try:

http://jsimlo.sk/notepad/
Great tip!

Best plain text editor ever ;-)
We'll see about that...


Now let's try this TED Notepad... :tellme:

- Open the file
- Select All (Ctrl-A)
- Select Tools/Lines/Columns, Numbers... (Alt-T,L,N or Alt-Ctrl-Y)
- Change Output mask to (Line length right aligned with zeros, separator |, original line)
%+l0|%0
- Press Cut (Alt-C), length and a separator are inserted in each line
- Select All (Ctrl-A)
- Sort Ascending (Tools/Sort/Ascending, Alt-T,S,A or Alt-Ctrl-A)
- Select All (Ctrl-A)
- Select Tools/Lines/Columns, Numbers... (Alt-T,L,N or Alt-Ctrl-Y)
- Change Output mask to
%1
- Change settings on %1 tab
  - Select 'Entire line'
  - Check: 'Use only characters from
  - set: 'position' to 5
  - set: 'to' to 999 (assuming no line is longer than 999 characters, or use 9999)
(Have Preview checked, then the preview should show the result without length and separator, if a column is missing change 5 to 4 or 3)
- Press Cut (Alt-C)
- Save result (Ctrl-S or Ctrl-B, Save as...)
- Job well done :D

NB: The use of a separator is entirely optional, ofcourse ;)

I kinda like this TED Notepad, looks like something safe enough for @Contro to handle ;D
793
Post New Requests Here / Re: Sort lines of a txt file by lenght of the string
« Last post by Ath on February 18, 2017, 08:43 AM »
Again a 'one-liner' this time using awk and sort:
awk '{ printf"%04d|%s\n",length($0),$0}' contro.txt|sort|awk -F'|' '{print $2}'
- first awk command adds the length and the separator, a vertical pipe
- sort command puts them in the desired order
- second awk command removes the length and the separator
to redirect to a file, add this at the end:
>length-sorted.txt

I've used Cygwin, then you might want/need to issue 'export LC_ALL=C' before running the command, else awk might give some error about binary data (the accented characters)
Couldn't find a way to do this in NotePad++ yet, maybe using the Python Script plugin for NotePad++, I'll investigate that later

I used your previous sample input text 'contro.txt' as input :P
794
Post New Requests Here / Re: Sort lines of a txt file by lenght of the string
« Last post by Ath on February 18, 2017, 08:08 AM »
insert the length, fixed format (0001 etc.), of each line in front of each line, with a separator
sort the file
remove the added columns, cut at the separator
795
Post New Requests Here / Re: Manipulate lines in a txt file
« Last post by Ath on February 18, 2017, 08:05 AM »
I take all this to home.
The problem is completely solved
Only if you have applied the 4 step NotePad++ solution, previous 2/3 step solutions aren't correctly removing the first phrase in all cases.

Thanks a lot  :tellme:
You're welcome. :up:
796
Post New Requests Here / Re: Manipulate lines in a txt file
« Last post by Ath on February 18, 2017, 05:54 AM »
Here's a better, 4 step, solution using NotePad++, realizing that the shortened words really mess up the removal of the 'first phrases' part.

Settings for Replace dialog (Ctrl-H):
Search mode: Regular expression
. matches newline: Off (=not checked)

Step 1: Replace shortened words with an alternative (_ used, assumed not to be anywhere in the document! )
Find what: (Dr|Mt|St|Lt)\.
Replace with: $1_

Step 2: Remove all first phrases, trim any leading white-space from the remaining part
Find what: [^\.]*?\.\s*(.*)
Replace with: $1\n
Press Replace all button

Step 3: Replace all remaining phrases by the phrase and a new-line, removing any white-space in front of a phrase
Find what: \s*([^\.]*?\.)
Replace with: $1\n
Press Replace all button

Step 4: Restore periods after all shortened words
Find what: _
Replace with: .
Press Replace all button
Done :D
797
Post New Requests Here / Re: Manipulate lines in a txt file
« Last post by Ath on February 18, 2017, 04:18 AM »
There are other issues with these type of free texts, the (short) example contains shortened words like St. and Dr. that cause excess line-breaks to be inserted. These can be fixed by adding another step to the Notepad++ recipe:
Step 3: (Restore shortened words with their second part)
Find what: (St\.|Dr\.)\n
Replace with: \1
Press Replace all button

If more shortened words are found, add them to Find what within the round braces, prefixed with a vertical pipe, like this for adding "Mt.":
(St\.|Dr\.|Mt\.)\n

NB: This won't (can't) work with PSPad! because of the limitations of Find & Replace.
NB2: I haven't found a way to keep the lines with a single period yet, but don't know if that's desired/required?

Also added to the the Notepad++ solution, above.
798
Post New Requests Here / Re: Manipulate lines in a txt file
« Last post by Ath on February 18, 2017, 03:23 AM »
Updated: Don't use PSPad for this operation, as it doesn't have a powerful enough Find & Replace operation, use NotePad++ or EditPad Lite (both free) instead.




Well, I also tried to run this with PSPad, but Find & Replace is quite less powerful than Notepad++ in this area (and even buggy, IMHO).
Open Find & Replace (Ctrl-H)
Regular Expressions needs to be checked, and I chose Direction: Entire scope
Step 1 needs an adjustment:
Replace: $1
Step 2 needs an no adjustment:
Replace: $1\n
Step 3 above can't be performed using PSPad.

Step 4 needs to be added for removing empty lines:
Choose Edit/Lines manipulation/Remove Blank Lines (Alt-E,N,M)
Voila :-\

NB: There are several reasons I dropped PSPad many years ago in favor of Notepad++, this is one of them.
Edit: Do not use PSPad for these operations. Alternatives mentioned.
799
Post New Requests Here / Re: Manipulate lines in a txt file
« Last post by Ath on February 18, 2017, 02:54 AM »
4 line
Según el autor de este artículo, Kent fue el creador directo de su Repertorio, mientras que sus otros escritos, fueron una recopilación de los apuntes o notas que sus alumnos tomaban durante las clases que él dictaba.

This is not such a good example, as it has only 1 period, so the entire line is removed in step 1...
800
Post New Requests Here / Re: Manipulate lines in a txt file
« Last post by Ath on February 18, 2017, 02:49 AM »
So I only have to trim the left and delete any empty line after deleting the first phrase of each line.
This is very easy with pspad, and I suppose too with notepad++
Hm, you didn't say you wanted to store the intermediate result too.
A small addition to step 1 would fix that:
Updated step 1:
Step 1: (Remove all first phrases, trim any leading white-space from the remaining part)
Find what: [^\.]*?\.\s*(.*)
Replace with: \1\n
Press Replace all button

I updated the original post for this Notepad++ solution.
Pages: prev1 ... 27 28 29 30 31 [32] 33 34 35 36 37 ... 146next