Welcome Guest.   Make a donation to an author on the site November 23, 2014, 03:52:21 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
The N.A.N.Y. Challenge 2011! Download 30+ custom programs!
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1] 2 Next   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: Finished Coding Snack: Organize Text  (Read 16334 times)
kalos
Member
**
Posts: 1,103

View Profile Give some DonationCredits to this forum member
« on: July 10, 2010, 04:40:28 PM »

hello

I don't know if it is easy to do what I want or there is a tool already available... well, I have a text file with a list of sentences (each sentence seperated with a newline)

what I want is to group/organize the sentences, by cutting them and pasting them to specific text files (other that the one with the sentences list)

so I want to automatically select a sentence, cut it, and paste it in the appropriate text file by clicking a shortcut key
then select the next one, cut and paste it in the appropriate text file, etc

to choose the appropriate target text file, where I want each sentence to go, I must click the relevant shorcut key

that would be very handy for this kind of job, any suggestion??

thanks
Logged
mouser
First Author
Administrator
*****
Posts: 33,690



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #1 on: July 10, 2010, 07:23:05 PM »

that's an interesting idea.. i can see cases where this might be useful in different forms.

as a coding snack you might imagine a program that loaded a text file and showed each line in a list, and let you quickly tag each line by hitting a digit 1-9 or letter a-z, so you could really quickly assign a "tag" to each line (or specific lines), and then hit let you perform some actions.

actions could be things like save each tag group to a dif file, or copy all items in a specific tag group to clipboard, etc.
Logged
kalos
Member
**
Posts: 1,103

View Profile Give some DonationCredits to this forum member
« Reply #2 on: July 10, 2010, 07:29:21 PM »

I suppose we are far from implementing something like this, right?
Logged
rgdot
Supporting Member
**
Posts: 1,661


View Profile WWW Give some DonationCredits to this forum member
« Reply #3 on: July 10, 2010, 07:50:49 PM »

I can see this being very useful to one text file sitting on my desktop right now.
Logged
skwire
Global Moderator
*****
Posts: 4,158



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #4 on: July 11, 2010, 07:57:39 AM »

Some questions:

1) How many target text files are we talking about here?  Unlimited?

2) When you say "click a shortcut key", do you mean clicking a button on a window or do you mean pressing a hotkey combo like ctrl-1?
Logged

Paul Keith
Member
**
Posts: 1,982


see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #5 on: July 11, 2010, 08:02:33 AM »

Isn't this similar to what steeladept was looking for in this topic?

http://www.donationcoder..../index.php?topic=22650.25

CCCCtrlC link
Logged

<reserve space for the day DC can auto-generate your signature from your personal PopUp Wisdom quotes>
skwire
Global Moderator
*****
Posts: 4,158



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #6 on: July 11, 2010, 08:20:42 AM »

@Paul Keith: Yes, it's similar but I think kalos wants something more automated where he doesn't have to manually copy a line to the clipboard, etc.
Logged

kalos
Member
**
Posts: 1,103

View Profile Give some DonationCredits to this forum member
« Reply #7 on: July 11, 2010, 08:30:45 AM »

Some questions:

1) How many target text files are we talking about here?  Unlimited?

2) When you say "click a shortcut key", do you mean clicking a button on a window or do you mean pressing a hotkey combo like ctrl-1?

1) I want about 10-20, but practically unlimited

2) both, it would be better to have both options, but for me clicking a button on a window would be faster than a combo
Logged
skwire
Global Moderator
*****
Posts: 4,158



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #8 on: July 11, 2010, 11:25:04 AM »

1) I want about 10-20, but practically unlimited
2) both, it would be better to have both options, but for me clicking a button on a window would be faster than a combo

If you want unlimited, I don't see how you expect to create a unique hotkey combo for each destination file.  Your thoughts?  Also, did you have any sort of GUI design in mind?
Logged

ha14
Participant
*
Posts: 268

View Profile Give some DonationCredits to this forum member
« Reply #9 on: July 11, 2010, 12:19:59 PM »

perhaps you need an automation tool where you designate a target, why you dont use a clipboard manager?
Logged
rgdot
Supporting Member
**
Posts: 1,661


View Profile WWW Give some DonationCredits to this forum member
« Reply #10 on: July 11, 2010, 12:25:16 PM »

1) I want about 10-20, but practically unlimited
2) both, it would be better to have both options, but for me clicking a button on a window would be faster than a combo

If you want unlimited, I don't see how you expect to create a unique hotkey combo for each destination file.  Your thoughts?  Also, did you have any sort of GUI design in mind?

Destination files or folders can be something like Ctrl+1, Ctrl+2, Ctrl+3, etc. can't they?
Logged
skwire
Global Moderator
*****
Posts: 4,158



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #11 on: July 11, 2010, 01:51:29 PM »

Destination files or folders can be something like Ctrl+1, Ctrl+2, Ctrl+3, etc. can't they?

Sure...but what if there are, as kalos wanted, twenty destination files?  Or fifty?
Logged

kalos
Member
**
Posts: 1,103

View Profile Give some DonationCredits to this forum member
« Reply #12 on: July 11, 2010, 02:04:23 PM »

yes hotkeys, they can be anything, maybe not unlimited, let's say 10?

I don't know if a clipboard manager can do that, it would be nice, if you know one please inform me
Logged
rjbull
Charter Member
***
Posts: 2,788

View Profile Give some DonationCredits to this forum member
« Reply #13 on: July 11, 2010, 02:38:30 PM »

If you want unlimited, I don't see how you expect to create a unique hotkey combo for each destination file.

Could you do it sort-of WordStar-style, with two keys, so that you pressed say Ctrl-0 to Ctrl-9, and each one popped up its own independent list of 0-9 + A-Z channels/bins/whatever you call them?  Hard to keep track of what was supposed to go where, but fairly easy to gain a lot of targets for not many hotkeys.
Logged
ha14
Participant
*
Posts: 268

View Profile Give some DonationCredits to this forum member
« Reply #14 on: July 11, 2010, 02:51:58 PM »

For a clipboard manager
try global clipboard
http://www.techishare.com...global-clipboard-manager/

TenClips
http://users.skynet.be/hofinger/TenClips.html

read this also
http://office.microsoft.c...graphics-HP005186111.aspx
http://office.microsoft.c...lipboard-HA010163602.aspx


Logged
kartal
Supporting Member
**
Posts: 1,529


View Profile Give some DonationCredits to this forum member
« Reply #15 on: July 11, 2010, 03:01:07 PM »

That is totally a Vim`s arena smiley
Logged
skwire
Global Moderator
*****
Posts: 4,158



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #16 on: July 11, 2010, 03:20:18 PM »

To all the folks suggesting clipboard managers, I think you're missing the point of kalos' request.  He doesn't want to MANUALLY cut/copy and paste, he wants something to automatically parse through a source text file and allow him to quickly send each line to a, potentially, different target file. 

For the sake of easier coding, let's assume a maximum of thirty targets, okay?  That way, each target can have a button as well as a hotkey:

1-10: Ctrl-1, Ctrl-2, Ctrl-3...
11-20: Ctrl-Shift-1, Ctrl-Shift-2, Ctrl-Shift-3...
21-30: Ctrl-Alt-1, Ctrl-Alt-2, Ctrl-Alt-3...
...or whichever combos you want.

Would this be acceptable?  Also, you didn't answer my question about GUI design.  What did you have in mind?  Did you want to see the whole source text file?  Or just sentence by sentence as it parses through it?  Or, did you want to leave it entirely up to me?
Logged

kalos
Member
**
Posts: 1,103

View Profile Give some DonationCredits to this forum member
« Reply #17 on: July 11, 2010, 03:22:23 PM »


I don't think any of these can do what I want

That is totally a Vim`s arena smiley

I 've heard so many good things about vim and similar unix text editors, but have not any experience

how easy can this be done with vim?
Logged
kalos
Member
**
Posts: 1,103

View Profile Give some DonationCredits to this forum member
« Reply #18 on: July 11, 2010, 03:27:16 PM »

To all the folks suggesting clipboard managers, I think you're missing the point of kalos' request.  He doesn't want to MANUALLY cut/copy and paste, he wants something to automatically parse through a source text file and allow him to quickly send each line to a, potentially, different target file. 

exactly

For the sake of easier coding, let's assume a maximum of thirty targets, okay?  That way, each target can have a button as well as a hotkey:

1-10: Ctrl-1, Ctrl-2, Ctrl-3...
11-20: Ctrl-Shift-1, Ctrl-Shift-2, Ctrl-Shift-3...
21-30: Ctrl-Alt-1, Ctrl-Alt-2, Ctrl-Alt-3...
...or whichever combos you want.

Would this be acceptable?  Also, you didn't answer my question about GUI design.  What did you have in mind?  Did you want to see the whole source text file?  Or just sentence by sentence as it parses through it?  Or, did you want to leave it entirely up to me?

yes, it would be acceptable, but simple letters would be nice too, where each of the letter is the initial of the target filename, anyway, that doesn't matter much

as for GUI, seeing sentence by sentence would be easier for the eyes, which won't be distracted by the above and below sentence, so it may be preferable

in case of seeing the whole source text file, there must be some way to see which sentence is about to be send to the target text file, maybe by highlighting it
Logged
JavaJones
Review 2.0 Designer
Charter Member
***
Posts: 2,537



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #19 on: July 11, 2010, 04:12:26 PM »

I don't need something like this at this exact moment, so my comments are more predictive for what I think I might want at some point. But this does seem like a useful feature, so I'll contribute my thoughts. Obviously Kalos' needs take precedence.

I think it makes most sense to take the step of making this a bit more versatile and allow it to operate not just on a single line but a selection. So I'd say show a window of the text file, but not necessarily the whole thing at once, allow for automatic single-line selection perhaps, but also click-drag selection and/or hold-shift-and-select-with-arrow-keys. The selection should be very clearly highlighted of course, maybe in yellow. But again I think the critical thing is not intentionally limiting it to a single line as that severely narrows the use of the tool in a way that I think is unnecessary to maintain the original utility needed. Clear highlighting should be enough.

- Oshyan
Logged

The New Adventures of Oshyan Greene - A life in pictures...
sword
Charter Member
***
Posts: 184


View Profile Give some DonationCredits to this forum member
« Reply #20 on: July 12, 2010, 02:03:02 PM »

1. Create shortcuts to your files.
2. Place the shortcuts on your desktop and open them.
3. Open the file that you want to process and drag selections to the opened files.
Logged
vinayakjoshi
Participant
*
Posts: 14


View Profile Give some DonationCredits to this forum member
« Reply #21 on: July 15, 2010, 04:08:23 AM »

I think you should use Clipmate (http://www.thornsoft.com/). The PowerPaste feature can help you quickly paste a series of clips, or break apart complex data by comma, linebreak, etc.

You can copy everything in one go; explode using linebreak; and then do powerpaste in the files that you want.

Regards
Vinayak
http://www.learningconcepts.in/
Logged
Jabberwock
Participant
*
Posts: 71

View Profile Give some DonationCredits to this forum member
« Reply #22 on: July 15, 2010, 04:13:37 AM »

Could it be a Microsoft Word macro?

The simplest way I can see is to open a document and then a selection of other documents to paste into. A macro would cut selected text and ask for user input (? in Word status bar). The user would input the filename, e.g. "1" and the text gets sent to the open "1.doc" (or "1.txt") document.

Advantages:
1. You stay in Word which might be useful for other word processing tasks you need to do with the text.
2. You have direct preview of all appended files, so you might clean them up immediately.
3. If the document names are short and easy to handle, no need to remember the shortcuts - log entries go into "Log", comments into "Comments" etc.
4. It should be simple - short code, no need for an external app to be running, etc.

Disadvantages:
1. You need Word (duh).
2. The document names may be either informative/usable etc. or easy to enter. I mean if you choose file names "1.txt", "2.txt" (for easy input) you have to rename them later anyway.

Edit: Could you describe the "automated" part of the request in more detail? What would be the criteria for parsing which you mention later (first you write about cutting etc.)?
Logged
ebs
Charter Member
***
Posts: 12

View Profile Give some DonationCredits to this forum member
« Reply #23 on: July 16, 2010, 03:33:21 PM »

kalos,

I have a need for a program like this from time to time. I've been too lazy to write one, but your request made me finally go ahead and do it.
How about this?



It's pretty simple to use:
1. Open your input file and each line is displayed in the top list.

2. Specify your output filenames in the bottom list. You can have up to 36 output files, corresponding to tags "0" to "9" and "A" to "Z".
    Files (and the necessary folders) are created if they don't exist. You can choose to overwrite or append to existing files.

3. Tag each line of the input file for the desired output file by pressing the appropriate key.
    The highlight automatically moves down the list as each line is tagged. You can use the Shift or Ctrl key to tag multiple lines.
    If you enter an incorrect tag, just select the line (or lines) and enter the new tag.

4. When you're done tagging input lines, click the "Write Files" button and your tagged lines will be written to the specified output files.

I've got the basic application written, but I want to add the ability to save output filenames,
so they don't have to be re-entered (if you use the same files each time).

If this would be useful, I would be glad to contribute it when I'm done - let me know.
Logged
cmpm
Charter Member
***
Posts: 2,025

View Profile Give some DonationCredits to this forum member
« Reply #24 on: July 16, 2010, 06:27:40 PM »

Something like this possibly?

http://blogs.msdn.com/b/j...a-page.aspx?wa=wsignin1.0

I was looking for a way to add the "send to" command to the right click context menu after highlighting text. This is all that came close so far. To 'send to' a text file.
« Last Edit: July 16, 2010, 06:30:12 PM by cmpm » Logged
Pages: [1] 2 Next   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.048s | Server load: 0.11 ]