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 14, 2024, 12:56 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

Last post Author Topic: N.A.N.Y. 2014 Release: Text Inspection & Manipulation Utility  (Read 157596 times)

DyNama

  • Supporting Member
  • Joined in 2010
  • **
  • Posts: 73
  • Are you a good witch or a bad witch?
    • View Profile
    • Donate to Member
Re: N.A.N.Y. 2014 Release: Text Inspection & Manipulation Utility
« Reply #100 on: July 07, 2015, 01:45 PM »
no prob, phitsc, TIMU has so many functions already that I have fun figuring out how to do stuff!

poyan

  • Supporting Member
  • Joined in 2010
  • **
  • Posts: 30
    • View Profile
    • DentalTrauma.info
    • Donate to Member
Text Inspection & Manipulation Utility
« Reply #101 on: August 02, 2015, 07:48 AM »
Hi,
just had the idea that it might be of interest to have some command line parameters.
This would allow to use some predefined sets (started by LBC, or FARR, or a shortcut, or ...) for some text manipulations which occur quite often (in the situation of the specific user, therefore leave it to the user which manipulations are chosen for this predefinition). That would spare
to open the program gui (which may still be an option for approval or additional tasks),
to search and chose the function (maybe scrolling necessary),
to chose/enter a number of parameters,
which could all be done with one click.
It is similar to storing parameters, which was already defined as most needed, but would even be more efficient than that:
I think the most needed feature would currently be storing parameters between sessions and when changing between individual text manipulations.

That was a note to self by the way.

Best regards, Yango

ConstanceJill

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 243
    • View Profile
    • Donate to Member
Re: N.A.N.Y. 2014 Release: Text Inspection & Manipulation Utility
« Reply #102 on: August 04, 2015, 11:12 AM »
I second that :)
I use it at work to do pretty much always the same manipulation, being able to have a shortcut so it always opens on that one with pre-filled fields would save me loads of time :]

phitsc

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 1,198
    • View Profile
    • Donate to Member
Re: N.A.N.Y. 2014 Release: Text Inspection & Manipulation Utility
« Reply #103 on: August 08, 2015, 04:56 AM »
0.18 is now available. I didn't do much testing so please report if it doesn't work as expected.

I've added command line options, added accepted escape characters to help and added Remove characters (all as requested above).

Examples:

TextManipulationUtility.exe -f "Remove characters"

Starts with the new Remove characters function selected.

TextManipulationUtility.exe -f "Remove characters" -p 5 -p 2

Additionally sets the first function parameter to 5 and the second to 2.

TextManipulationUtility.exe -f "Remove characters" -p 5 -p 2 "This is some example text to put into input field"

Additionally populates the input field with the leftover text which is not associated to a command line argument.

Last but not least a file can be specified to load into the input field with the -i command line argument.

@DyNama word boundary is currently done via regex \w+. I agree it's probably not the best decision. Will change it. I've added Trim number of characters (Remove characters). Will look into your spaces and padding requst next.

ConstanceJill

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 243
    • View Profile
    • Donate to Member
Re: N.A.N.Y. 2014 Release: Text Inspection & Manipulation Utility
« Reply #104 on: August 10, 2015, 03:42 AM »
Great, works for me :]

poyan

  • Supporting Member
  • Joined in 2010
  • **
  • Posts: 30
    • View Profile
    • DentalTrauma.info
    • Donate to Member
Re: N.A.N.Y. 2014 Release: Text Inspection & Manipulation Utility
« Reply #105 on: August 12, 2015, 09:33 PM »
Hi, seems to work as you intended.


I suggest to go also the last step: return the results.
If the text has come from the clipboard send the manipulated text back to the clipboard. 
If it has come from the command line, return it by stdout.
If it has come from a file, write the text to a file. Let the user decide whether he would prefer to overwrite the old file, to use a new filename, or to archive the old file and to save the new file with the original filename. Or just offer the first option, but keep the original text for a possible go back.
On demand, open the program gui, but enable a quiet run.

Any idea for using multiple functions on the text?
Just some proposals from a lazy user who tries to reduce the number of unnecessary keystrokes / mouseclicks.

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: N.A.N.Y. 2014 Release: Text Inspection & Manipulation Utility
« Reply #106 on: October 22, 2015, 11:00 AM »
@phitsc: i have a feature request if it is not already possible. i would like to take a list and add a punctuation-like chars at the end of each line but aligned to the longest item on the list.

i pasted the sample list in the pastebin link below.

http://pastebin.com/JLKbat9h

ConstanceJill

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 243
    • View Profile
    • Donate to Member
Re: N.A.N.Y. 2014 Release: Text Inspection & Manipulation Utility
« Reply #107 on: October 22, 2015, 02:29 PM »
Is it aligned using tabulations, and assuming a monospace font?
I'd guess you'll need to specify how many spaces a tabulation equals then (for how many are required to get to the end of the longest line from a shorter one would depend on that).

DyNama

  • Supporting Member
  • Joined in 2010
  • **
  • Posts: 73
  • Are you a good witch or a bad witch?
    • View Profile
    • Donate to Member
Re: N.A.N.Y. 2014 Release: Text Inspection & Manipulation Utility
« Reply #108 on: October 23, 2015, 03:58 AM »
Fab, phitsc, love "Remove characters" and command line options! I had Replaced spaces with commas, then Delete to Tag entering a comma, now all I have to do is Remove characters -p 45!

Oddly enuf, I had requested a function to remove padding, while lanux128 is wanting a function to add padding, which I can see could be very useful, since I am editing text tables too. I played with lanux128's text for a while in TIMU, i could not figure out a way to pad all the lines to a certain length.

I had been pasting the output from TIMU into a spreadsheet just to add up the numeric values, then I got a macro to Sum All Values in the clipboard, but this would also be a good trick for TIMU! Sum the values of every line in input that starts with a number, ignoring any characters in each line after a number+delimiter, the output would be the input unchanged, with just an additional line at the bottom with the total.

TIMU is a fabulous utility! Thanx, phitsc!
« Last Edit: October 23, 2015, 01:37 PM by DyNama, Reason: elucidation »

DyNama

  • Supporting Member
  • Joined in 2010
  • **
  • Posts: 73
  • Are you a good witch or a bad witch?
    • View Profile
    • Donate to Member
Re: N.A.N.Y. 2014 Release: Text Inspection & Manipulation Utility
« Reply #109 on: October 23, 2015, 01:20 PM »
Here's something else TIMU could help me with. Occasionally i want to edit a greasemonkey javascript so i open it in notepad, and it looks like this:

Code: Javascript [Select]
  1. // ==UserScript==// @name        Mouseover Popup Image Viewer// @namespace   http://w9p.co/userscripts/// @description Shows images and videos behind links and thumbnails.// @version     2015.10.11.1// @author      kuehlschrank// @homepage    http://w9p.co/userscripts/mpiv/// @icon        https://w9p.co/userscripts/mpiv/icon.png// @grant       GM_getValue// @grant       GM_setValue// @grant       GM_xmlhttpRequest// @grant       GM_openInTab// @grant       GM_registerMenuCommand// @grant       GM_setClipboard// ==/UserScript==

but if i paste it into TIMU input box, it looks like this without any editing:

Code: Javascript [Select]
  1. // ==UserScript==
  2. // @name        Mouseover Popup Image Viewer
  3. // @namespace   http://w9p.co/userscripts/
  4. // @description Shows images and videos behind links and thumbnails.
  5. // @version     2015.10.11.1
  6. // @author      kuehlschrank
  7. // @homepage    http://w9p.co/userscripts/mpiv/
  8. // @icon        https://w9p.co/userscripts/mpiv/icon.png
  9. // @grant       GM_getValue
  10. // @grant       GM_setValue
  11. // @grant       GM_xmlhttpRequest
  12. // @grant       GM_openInTab
  13. // @grant       GM_registerMenuCommand
  14. // @grant       GM_setClipboard
  15. // ==/UserScript==

It would seem in notepad carriage returns aren't being interpreted as carriage return+linefeed. if without edit, i press the output box Copy to Clipboard, the copy will still not have linefeeds when i paste it back into notepad.

But if i manually select the text in the output box with my mouse, it will have linefeeds! Pasted back into notepad, it will look like the latter!

I have a macro that works on the text in the clipboard, it simply replaces all the carriage returns with carriage return+linefeeds:

Code: C [Select]
  1. using System;
  2.  
  3. public static class ClipboardFusionHelper
  4. {
  5.     public static string ProcessText(string text)
  6.     {
  7.         return text.Replace("\n","\r\n");
  8.     }
  9. }

i copy the "unformatted" javascript in notepad to clipboard, run the macro, paste it right back into notepad, and the text is now "formatted." Perhaps TIMU could do that too.
« Last Edit: October 23, 2015, 01:41 PM by DyNama, Reason: elucidation »

phitsc

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 1,198
    • View Profile
    • Donate to Member
Re: N.A.N.Y. 2014 Release: Text Inspection & Manipulation Utility
« Reply #110 on: October 23, 2015, 02:53 PM »
That all sound like good ideas. I was thinking about a timu reboot for this years NANY. What I had in mind was making it a cross-platform application. Probably command line to begin with and adding back the GUI after that. Would also like to add proper tests this time.

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,629
    • View Profile
    • Donate to Member
Re: N.A.N.Y. 2014 Release: Text Inspection & Manipulation Utility
« Reply #111 on: October 24, 2015, 06:25 AM »
It would seem in notepad carriage returns aren't being interpreted as carriage return+linefeed. if without edit, i press the output box Copy to Clipboard, the copy will still not have linefeeds when i paste it back into notepad.
Notepad doesn't support linux-formatted text (line-feed only), so I'd reccommend using a decent editor (lots of free notepad replacements available), and forget notepad even exists.

DeVamp

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 122
  • Let the coding begin :-)
    • View Profile
    • Donate to Member
Re: N.A.N.Y. 2014 Release: Text Inspection & Manipulation Utility
« Reply #112 on: November 18, 2015, 09:20 AM »
Hey,

I have a question about the replace regex.

I have an XML file (simplified as example)
<road>
  <1>
    <car color="red">car1</car>
    <car color="blue">car2</car>
    ...
  </1>
  <2>
    ...
  </2>
  <3>
    ...
  </3>
... till <39>
</road>

Now I was hoping I could change the <1></1> till <39></39>
into <lane1></lane1> till <lane39></lane39>

I use <[0123456789]> as Search regular expression, and that selects the first tags correctly.
But I have no clue how to provide something from the searched text into the replacement text.

Could you explain a bit how to use the regex replace.

Thank you.

phitsc

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 1,198
    • View Profile
    • Donate to Member
Re: N.A.N.Y. 2014 Release: Text Inspection & Manipulation Utility
« Reply #113 on: November 18, 2015, 10:26 AM »
I'm afraid that is not currently possible. Shouldn't be too hard to add though. Stay tuned...

hamradio

  • Charter Honorary Member
  • Joined in 2006
  • ***
  • Posts: 884
  • Amateur Radio Guy
    • View Profile
    • HamRadioUSA.net
    • Read more about this member.
    • Donate to Member
Re: N.A.N.Y. 2014 Release: Text Inspection & Manipulation Utility
« Reply #114 on: November 18, 2015, 03:31 PM »
Hey,

I have a question about the replace regex.

I have an XML file (simplified as example)
<road>
  <1>
    <car color="red">car1</car>
    <car color="blue">car2</car>
    ...
  </1>
  <2>
    ...
  </2>
  <3>
    ...
  </3>
... till <39>
</road>

Now I was hoping I could change the <1></1> till <39></39>
into <lane1></lane1> till <lane39></lane39>

I use <[0123456789]> as Search regular expression, and that selects the first tags correctly.
But I have no clue how to provide something from the searched text into the replacement text.

Could you explain a bit how to use the regex replace.

Thank you.


I am a user of both TIMU and WildGem so in the meantime while it gets worked on for this one...you can do it with WildGem which can be found on DonationCoder forum as well at: https://www.donation...ex.php?topic=41103.0

I used <(/?)(\d+?)> for regex and for replacement text <$1lane$2>.

It worked with your example. :)

phitsc

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 1,198
    • View Profile
    • Donate to Member
Re: N.A.N.Y. 2014 Release: Text Inspection & Manipulation Utility
« Reply #115 on: November 18, 2015, 03:53 PM »
DeVamp, you can try with vers. 0.19 and use hamradio's regex, but use <\1lane\2> as replacement text. Then compare the output with what WildGem gives you and tell me if it's the same ;D.

\1 will be replaced with what's captured for the first group (defined by the () in the regex), \2 by what's in the second group, etc.

Still glad someone finds TIMU useful! :Thmbsup:

hamradio

  • Charter Honorary Member
  • Joined in 2006
  • ***
  • Posts: 884
  • Amateur Radio Guy
    • View Profile
    • HamRadioUSA.net
    • Read more about this member.
    • Donate to Member
Re: N.A.N.Y. 2014 Release: Text Inspection & Manipulation Utility
« Reply #116 on: November 18, 2015, 04:51 PM »
DeVamp, you can try with vers. 0.19 and use hamradio's regex, but use <\1lane\2> as replacement text. Then compare the output with what WildGem gives you and tell me if it's the same ;D.

\1 will be replaced with what's captured for the first group (defined by the () in the regex), \2 by what's in the second group, etc.

Still glad someone finds TIMU useful! :Thmbsup:

It works for me in TIMU 0.19 now too like he said...

I used <(/?)(\d+?)> for regex and for replacement text <\1lane\2>.  So either will work now with the update to TIMU to 0.19. :)

phitsc

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 1,198
    • View Profile
    • Donate to Member
Re: N.A.N.Y. 2014 Release: Text Inspection & Manipulation Utility
« Reply #117 on: November 19, 2015, 01:31 AM »
Thanks hamradio for the testing :Thmbsup:

DeVamp

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 122
  • Let the coding begin :-)
    • View Profile
    • Donate to Member
Re: N.A.N.Y. 2014 Release: Text Inspection & Manipulation Utility
« Reply #118 on: November 19, 2015, 02:47 AM »
DeVamp, you can try with vers. 0.19 and use hamradio's regex, but use <\1lane\2> as replacement text. Then compare the output with what WildGem gives you and tell me if it's the same ;D.

\1 will be replaced with what's captured for the first group (defined by the () in the regex), \2 by what's in the second group, etc.

Still glad someone finds TIMU useful! :Thmbsup:
Ow yeah....... This is awesome...... the possibilities......

Thank you very much.

It is just an awesome tool. :)
I use it almost daily. :)


I am a user of both TIMU and WildGem so in the meantime while it gets worked on for this one...you can do it with WildGem which can be found on DonationCoder forum as well at: https://www.donation...ex.php?topic=41103.0

I used <(/?)(\d+?)> for regex and for replacement text <$1lane$2>.

It worked with your example. :)
This is also a nice tool to create the regex expression.
Thanks for the link :)

phitsc

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 1,198
    • View Profile
    • Donate to Member
Re: N.A.N.Y. 2014 Release: Text Inspection & Manipulation Utility
« Reply #119 on: November 19, 2015, 02:53 AM »
I usually turn to https://regex101.com/ to create / test regexes.

DeVamp

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 122
  • Let the coding begin :-)
    • View Profile
    • Donate to Member
Re: N.A.N.Y. 2014 Release: Text Inspection & Manipulation Utility
« Reply #120 on: November 19, 2015, 03:04 AM »
Ow indeed. nice that you get the explanation of the regex.

Thanks :)

ConstanceJill

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 243
    • View Profile
    • Donate to Member
Re: N.A.N.Y. 2014 Release: Text Inspection & Manipulation Utility
« Reply #121 on: May 11, 2017, 10:52 AM »
Hi there .o/

I found some sort of "bug", which is actually something I've seen in several applications so far.

Here are the steps to reproduce:
- have the program's window opened, but not maximized
- reduce it to the task bar
- close the program by right-clicking its button in the taskbar and selecting "Close this window"

When you run the program again, its window doesn't show, even if you click the button on the taskbar (which would normally restore the window).

From what another developer told me a while back, that is related to how Windows treats window reduction: it just moves the window to coordinates "far, far away" outside of the desktop's resolution. Thus when you close the program, it saves those coordinates... and when it runs again, its window is always at a position outside of the desktop.

You still can make it visible again by maximizing the window (using the system menu which you can bring up with Alt + spacebar), but it's kinda not cool having to do so.
You could also edit the coordinates in the user.config file somewhere under "%localappdata%\TextManipulationUtility" to have it back into the visible area of the desktop… but it would be much better if the program checked whether or not the coordinates specified in there are visible or not according to the current desktop's resolution, and if not, reset the window's position.

hamradio

  • Charter Honorary Member
  • Joined in 2006
  • ***
  • Posts: 884
  • Amateur Radio Guy
    • View Profile
    • HamRadioUSA.net
    • Read more about this member.
    • Donate to Member
Re: N.A.N.Y. 2014 Release: Text Inspection & Manipulation Utility
« Reply #122 on: May 11, 2017, 06:48 PM »
Hi there .o/

I found some sort of "bug", which is actually something I've seen in several applications so far.

Here are the steps to reproduce:
- have the program's window opened, but not maximized
- reduce it to the task bar
- close the program by right-clicking its button in the taskbar and selecting "Close this window"

When you run the program again, its window doesn't show, even if you click the button on the taskbar (which would normally restore the window).

From what another developer told me a while back, that is related to how Windows treats window reduction: it just moves the window to coordinates "far, far away" outside of the desktop's resolution. Thus when you close the program, it saves those coordinates... and when it runs again, its window is always at a position outside of the desktop.

You still can make it visible again by maximizing the window (using the system menu which you can bring up with Alt + spacebar), but it's kinda not cool having to do so.
You could also edit the coordinates in the user.config file somewhere under "%localappdata%\TextManipulationUtility" to have it back into the visible area of the desktop… but it would be much better if the program checked whether or not the coordinates specified in there are visible or not according to the current desktop's resolution, and if not, reset the window's position.
-ConstanceJill (May 11, 2017, 10:52 AM)

Not the author but in .net (CSharp) anyway developers can check for minimized programs and account for that...Here is an example if it will help anyone.  As noted not complete code, but might get coders a start with it.

Example Save Settings (Not Complete Code) CSharp
Code: C# [Select]
  1. if (this.WindowState == FormWindowState.Maximized || this.WindowState == FormWindowState.Minimized)
  2. {
  3.     SaveSettingsData.ClosedState.Left = this.RestoreBounds.Left;
  4.     SaveSettingsData.ClosedState.Top = this.RestoreBounds.Top;
  5.     SaveSettingsData.ClosedState.Width = this.RestoreBounds.Width;
  6.     SaveSettingsData.ClosedState.Height = this.RestoreBounds.Height;
  7.  
  8.     if (this.WindowState == FormWindowState.Minimized)
  9.     {
  10.         SaveSettingsData.ClosedState.wasMaximized = false;
  11.     }
  12.     else
  13.     {
  14.         SaveSettingsData.ClosedState.wasMaximized = true;
  15.     }
  16. }
  17. else
  18. {
  19.     SaveSettingsData.ClosedState.Left = this.Left;
  20.     SaveSettingsData.ClosedState.Top = this.Top;
  21.     SaveSettingsData.ClosedState.Width = this.Width;
  22.     SaveSettingsData.ClosedState.Height = this.Height;
  23.     SaveSettingsData.ClosedState.wasMaximized = false;
  24. }


Example Load Settings (Not Complete Code) CSharp
Code: C# [Select]
  1. this.Left = LoadSettingsData.ClosedState.Left;
  2. this.Top = LoadSettingsData.ClosedState.Top;
  3. this.Width = LoadSettingsData.ClosedState.Width;
  4. this.Height = LoadSettingsData.ClosedState.Height;
  5.  
  6. if (LoadSettingsData.ClosedState.wasMaximized == true)
  7. {
  8.     this.WindowState = FormWindowState.Maximized;
  9. }
  10. else if (LoadSettingsData.ClosedState.wasMaximized == false)
  11. {
  12.     this.WindowState = FormWindowState.Normal;
  13. }


Note: It will even restore back down correctly after an application restart if it was maximized too with my example I believe.
« Last Edit: May 11, 2017, 07:04 PM by hamradio »

ConstanceJill

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 243
    • View Profile
    • Donate to Member
Re: N.A.N.Y. 2014 Release: Text Inspection & Manipulation Utility
« Reply #123 on: May 12, 2017, 06:39 AM »
I currently see two ways to handle the problem, one of which seems better in my opinion (and I'll explain why):

1 - check if the window is minimized or not when saving the settings
2 - check the desktop's "visible area" limits/coordinates when starting the program

I think option 2 is better because it doesn't only handle the case of the program being minimized, but also other cases such as the user having switched from a dual to single monitor desktop, for example someone with a laptop and an external monitor on its dock, who obviously doesn't have that second monitor available when travelling.

Of course, I suppose you could do 1 and 2.

phitsc

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 1,198
    • View Profile
    • Donate to Member
Re: N.A.N.Y. 2014 Release: Text Inspection & Manipulation Utility
« Reply #124 on: May 16, 2017, 02:45 PM »
Hello ConstanceJill,

Glad to hear someone is still using this application, if only to minimize and close it ;)

Thanks for reporting this issue. I have fixed it as to your suggestion 2. Thanks hamradio for chiming in with a suggestion as well.

The new release can be downloaded from here: https://github.com/p...tionUtility-0.20.zip

This project is now open source :D