topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • Sunday September 20, 2026, 12:47 pm
  • 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 ... 47 48 49 50 51 [52] 53 54 55 56 57 ... 158next
1276
As I told you already, nobody can know which space to delete and which not.

Actually, so long as distorted text has extra spaces between ALL characters (which includes the space character), you can make this work.  Every real space will have two spaces instead of one so you can do it like this:

Code: Autohotkey [Select]
  1. #T:: ; Windows+T hotkey.  Change as desired.
  2. {
  3.     ; T h i s  i s  a  v e r y  s h o r t  s c r i p t  ; Sample of distorted text.
  4.     ;        ^^   ^^ ^^       ^^         ^^             ; Double spaces where single spaces should be.
  5.  
  6.     Clipboard := "" ; Empty the clipboard.
  7.     Send, ^c        ; Copy selected text to the clipboard.
  8.     ClipWait, 2     ; Wait for text to be put on the clipboard.
  9.    
  10.     ; Transform text.
  11.     myString := Clipboard
  12.     myString := StrReplace( myString, "  ", "§" ) ; Replace all double-spaces with a temporary section (§) character.
  13.     myString := StrReplace( myString, " ", "" )   ; Collapse remaining spaces.
  14.     myString := StrReplace( myString, "§", " " )  ; Replace temporary section (§) characters with a single space.
  15.    
  16.     Clipboard := myString ; Copy new string back to the clipboard.
  17. }
  18. Return

Contro, give the above AHK code a try and see if it works for you.  Again, this will only work if each real space is actually two spaces when your text is distorted.
Yes. That is exactly my case in this moment.

I will try and comment
1277
Couldn't this be done with "Find and Replace"?

  • Select the text you want to modify.
  • Do a search for " "
  • Do a replace for ""
  • Done.
It's a good answer just because I can select the precise text I need to transform.
Not the spaces between words, one word once a time.
May be a manual solution, but goes well and is better than modify everything by manual.

 :-*
1278
As I told you already, nobody can know which space to delete and which not.

I know the answer. But I keep trying : I want other answer !!!!!







 
1279
Delete one space between letters in distorted text lines .

The target is select the text we want to transform and apply the measure.


Best Regards

1280
Post New Requests Here / Re: Help to install a java script or similar CRGREP
« Last post by Contro on March 04, 2017, 05:22 AM »
Most difficult part for you might be to install Java, and set up the JAVA_HOME environment variable.
What OS are you currently on? Windows 7 or Windows 10 (any other Windows I can't make screenshots on, as I've always refused to use Win8/8.1)

Oh, btw, it works like a charm, just tested it with a couple of Office 2013 documents, and found any word I threw at it :up:
sample command-line:
C:\Users\Ath\Documents>..\Downloads\Contro\crgrep-1.0.5\bin\crgrep -i word *.docx
The -i is for case-insensitive search
I have windows 8.1

I take screenshots with Screenshot Captor
1281
Post New Requests Here / Re: Help to install a java script or similar CRGREP
« Last post by Contro on March 04, 2017, 05:21 AM »
Thanks a lot Ath.
I have Java already install. I need to digitally sign in the web with digital certificates.
But perhaps I need a java version for developing.

If don't replace is not useful to my purpose.
1282
Post New Requests Here / Re: Sort lines of a txt file by lenght of the string
« Last post by Contro on March 04, 2017, 05:18 AM »
Problem solved.
I have tried some of the above help with good result.
 :-[
1283
Post New Requests Here / Re: Manipulate lines in a txt file
« Last post by Contro on March 04, 2017, 05:14 AM »
Sorry I was trying to quote wraith808, but fails.

If a line is composed of several phrases delete until the beginning of the next phrase. Each phrase must finish in a period. So is determine the first character after the period (except the space...).

But I have this resolve up the lines. I was revising because I don't like forget the thread.
1284
Post New Requests Here / Re: Manipulate lines in a txt file
« Last post by Contro on March 04, 2017, 05:11 AM »
if the line is Phrase1. phrase 2 . Phrase3.
remain

phrase 2 . Phrase3.

Delete until the beginning of the phrase number 2
1285
Post New Requests Here / Help to install a java script or similar CRGREP
« Last post by Contro on March 03, 2017, 01:05 PM »
I am trying to collect software able to search and replace strings in word documents and other :

https://www.donation...?topic=43556.new#new

Until the moment this seems to be the more powerful. But I fail installing. So I need a little more help.

https://sourceforge.net/projects/crgrep/

1286
I have found several I can try.
Replace Genius
Word Fisher . And old traduction program with a trial free forever. At least I find a name and password for that. I have to try if true.
VBA Find and replace. Is an utility to find and replace in word documents.
CR GREP This java program promises to be powerful, but I need help to install
Funduc Word Search and replace freware.
Codeplex Find and Replace.

In the paid scene there are also trials . The most powerful seems to be able to read strings in pdf, word, etc.

But the point is that they are able to read in certain parts of a word document : header, footer, in comments, etc.

I am trying Replace Genius with a standard word document of 60 pages, with other documents inserted, goldmine fields, excel tables incrustated, jpg inserted and vinculated documents .

Until the moment Replace Genius goes well to my purpose.

PowerGREP and WordPipe seems to be very powerful.

CRGrep promises to be equal power of powergrep and wordpipe and seems freeware.

So I will put a consultation in the snack forum asking for help to install.
Seems need java and comes with a bat file.
Also have instruccions I don't understand.

Best Regards
1287
General Software Discussion / Batch for Docs (search and replacer and format)
« Last post by Contro on February 27, 2017, 09:44 AM »
I need a free program for search and replace in multiple word files able to :
- Insert a text after the located string , or before
- Replace the located string by a new one
- Format the located string in several ways (bold, highlight, etc. )

Is it possible ?

Best Regards

 
1288
Post New Requests Here / Re: Sort lines of a txt file by lenght of the string
« Last post by Contro on February 20, 2017, 06:46 AM »
Running to try. I will comment !
1289
Post New Requests Here / Re: Sort lines of a txt file by lenght of the string
« Last post by Contro on February 19, 2017, 03:43 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...
I think very interesting to load a python script.
It's new for me.

Can I try again ?
 :-*
1290
Post New Requests Here / Re: Sort lines of a txt file by lenght of the string
« Last post by Contro on February 19, 2017, 03:42 PM »
Where have I to put the name of my txt file in the script ?
The first line says
Code: Autohotkey [Select]
  1. FileRead, text, %A_ScriptFullPath%
replace it with
Code: Autohotkey [Select]
  1. FileRead, text, pathtoyour\file.txt
Assuming you want to save it replace MsgBox %text% with
Code: Autohotkey [Select]
  1. FileDelete, pathtoyour\sortedfile.txt
  2. FileAppend, %text%, pathtoyour\sortedfile.txt
Trying. Best Regards

I think I got. Is fast and easy. Best Regards
1291
Post New Requests Here / Re: Sort lines of a txt file by lenght of the string
« Last post by Contro on February 19, 2017, 03:36 PM »
Where have I to put the name of my txt file in the script ?
The first line says
Code: Autohotkey [Select]
  1. FileRead, text, %A_ScriptFullPath%
replace it with
Code: Autohotkey [Select]
  1. FileRead, text, pathtoyour\file.txt
Assuming you want to save it replace MsgBox %text% with
Code: Autohotkey [Select]
  1. FileDelete, pathtoyour\sortedfile.txt
  2. FileAppend, %text%, pathtoyour\sortedfile.txt
Trying. Best Regards
1292
Post New Requests Here / Re: Sort lines of a txt file by lenght of the string
« Last post by Contro on February 19, 2017, 02:47 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...
Don't worry I keep trying.

But it's strange for me. I think i am doing well.
Any option left ?

1293
Post New Requests Here / Re: Sort lines of a txt file by lenght of the string
« Last post by Contro on February 19, 2017, 02:43 PM »
I am doing bad. I obtain an error with the python script.

The screenshots :

AsusPortatil - 19_02_2017 , 20_31_44.pngAsusPortatil - 19_02_2017 , 20_38_48.pngAsusPortatil - 19_02_2017 , 20_39_45.pngAsusPortatil - 19_02_2017 , 20_40_18.pngAsusPortatil - 19_02_2017 , 20_42_25.png
1294
Post New Requests Here / Re: Sort lines of a txt file by lenght of the string
« Last post by Contro on February 19, 2017, 02:18 PM »
For reference: short AutoHotkey example (one of several you can find there on the forum) https://autohotkey.c...ine-length/?p=149560
Where have I to put the name of my txt file in the script ?

1295
Post New Requests Here / Re: Sort lines of a txt file by lenght of the string
« Last post by Contro on February 19, 2017, 02:16 PM »
For reference: short AutoHotkey example (one of several you can find there on the forum) https://autohotkey.c...ine-length/?p=149560

Trying
1296
Post New Requests Here / Re: Sort lines of a txt file by lenght of the string
« Last post by Contro on February 19, 2017, 02:15 PM »
Hi Contro

You can try http://www.miniwebto...sort-text-by-length/

I got below result,

[ Invalid Attachment ]

Regards,

Anand

This method works fine.
1297
Post New Requests Here / Re: Sort lines of a txt file by lenght of the string
« Last post by Contro on February 19, 2017, 02:14 PM »
AsusPortatil - 19_02_2017 , 19_54_59.pngAsusPortatil - 19_02_2017 , 19_55_55.pngAsusPortatil - 19_02_2017 , 19_56_30.pngAsusPortatil - 19_02_2017 , 19_56_41.pngAsusPortatil - 19_02_2017 , 19_56_46.pngAsusPortatil - 19_02_2017 , 19_56_57.pngAsusPortatil - 19_02_2017 , 19_57_02.pngAsusPortatil - 19_02_2017 , 19_57_09.pngAsusPortatil - 19_02_2017 , 19_57_20.pngAsusPortatil - 19_02_2017 , 19_57_46.pngAsusPortatil - 19_02_2017 , 19_58_10.pngAsusPortatil - 19_02_2017 , 19_58_40.pngAsusPortatil - 19_02_2017 , 19_59_12.pngAsusPortatil - 19_02_2017 , 20_00_21.png
1298
Post New Requests Here / Re: Sort lines of a txt file by lenght of the string
« Last post by Contro on February 19, 2017, 02:09 PM »
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:
[Select]

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]

    # Ath: Found this in the notepad-plus forum on sourceforge.net, modified as suggested in the comments there
    editor.beginUndoAction()
    if editor.getSelText(): # grab the lines
        linee = editor.getSelText().splitlines()
    else:
        linee = editor.getText().splitlines()
    sorted_lines=sorted(linee,key=lambda x:len(x)) # add parameter reverse=True, to sort descending by length
    editor.clearAll() # wipe lines in editor
    for line in sorted_lines:
            print(line) # put all lines back in the editor
    editor.endUndoAction()

- 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

I will try too.

The other method with notepad ted give me no results.

The zeros stay in the final result ?



1299
Post New Requests Here / Re: Sort lines of a txt file by lenght of the string
« Last post by Contro on February 19, 2017, 01:51 PM »
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.
I am going to try.
I was making by hand , not copy / paste.
I will put screenshots .

Trying !
1300
Post New Requests Here / Re: Sort lines of a txt file by lenght of the string
« Last post by Contro on February 19, 2017, 05:27 AM »
I have tried. But I think i am doing something wrong.
Simple don't get results .

And try to apply all the steps !!!
 :-[
Pages: prev1 ... 47 48 49 50 51 [52] 53 54 55 56 57 ... 158next