Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • September 29, 2016, 01:45:08 PM
  • Proudly celebrating 10 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 47451 times)

DyNama

  • Supporting Member
  • Joined in 2010
  • **
  • Posts: 72
  • 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:48 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:07 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: 84
    • View Profile
    • Donate to Member
Re: N.A.N.Y. 2014 Release: Text Inspection & Manipulation Utility
« Reply #102 on: August 04, 2015, 11:12:25 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,186
    • View Profile
    • Donate to Member
Re: N.A.N.Y. 2014 Release: Text Inspection & Manipulation Utility
« Reply #103 on: August 08, 2015, 04:56:43 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: 84
    • View Profile
    • Donate to Member
Re: N.A.N.Y. 2014 Release: Text Inspection & Manipulation Utility
« Reply #104 on: August 10, 2015, 03:42:31 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:03 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,258
    • View Profile
    • Coding Snacks by Lanux128
    • Read more about this member.
    • Donate to Member
Re: N.A.N.Y. 2014 Release: Text Inspection & Manipulation Utility
« Reply #106 on: October 22, 2015, 11:00:23 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: 84
    • View Profile
    • Donate to Member
Re: N.A.N.Y. 2014 Release: Text Inspection & Manipulation Utility
« Reply #107 on: October 22, 2015, 02:29:14 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: 72
  • 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:55 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:59 PM by DyNama, Reason: elucidation »

DyNama

  • Supporting Member
  • Joined in 2010
  • **
  • Posts: 72
  • 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:33 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:30 PM by DyNama, Reason: elucidation »

phitsc

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 1,186
    • View Profile
    • Donate to Member
Re: N.A.N.Y. 2014 Release: Text Inspection & Manipulation Utility
« Reply #110 on: October 23, 2015, 02:53:17 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: 2,751
    • View Profile
    • Donate to Member
Re: N.A.N.Y. 2014 Release: Text Inspection & Manipulation Utility
« Reply #111 on: October 24, 2015, 06:25:58 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: 116
  • 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:05 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,186
    • View Profile
    • Donate to Member
Re: N.A.N.Y. 2014 Release: Text Inspection & Manipulation Utility
« Reply #113 on: November 18, 2015, 10:26:11 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: 674
  • 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:58 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: http://www.donationc...ex.php?topic=41103.0

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

It worked with your example. :)
Carroll - HamRadioUSA.net

phitsc

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 1,186
    • View Profile
    • Donate to Member
Re: N.A.N.Y. 2014 Release: Text Inspection & Manipulation Utility
« Reply #115 on: November 18, 2015, 03:53:32 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: 674
  • 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:20 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. :)
Carroll - HamRadioUSA.net

phitsc

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

DeVamp

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 116
  • 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:17 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: http://www.donationc...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,186
    • View Profile
    • Donate to Member
Re: N.A.N.Y. 2014 Release: Text Inspection & Manipulation Utility
« Reply #119 on: November 19, 2015, 02:53:28 AM »
I usually turn to https://regex101.com/ to create / test regexes.

DeVamp

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 116
  • 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:57 AM »
Ow indeed. nice that you get the explanation of the regex.

Thanks :)