How can I copy a text from notepad? Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
BNOLI
Posts: 548
Joined: 23 Mar 2020, 03:55

Re: How can I copy a text from notepad?

Post by BNOLI » 28 Apr 2020, 09:52

You're able to eliminate duplicate identical sections using AHK's Sort command (preferably done at the clipboard's content). Unfortunately, those returned two sections aren't identical (I had to be advised myself by my fellow German @haichen to spot the difference! And yes, it's about an error). :mrgreen:
So you have to rethink your conditions and/or the data consistency of your source (files).
Remember to use [code]CODE[/code]-tags for your multi-line scripts. Stay safe, stay inside, and remember washing your hands for 20 sec !

Marcosa1020
Posts: 160
Joined: 23 Sep 2015, 19:15

Re: How can I copy a text from notepad?

Post by Marcosa1020 » 28 Apr 2020, 19:39

BNOLI wrote:
28 Apr 2020, 09:52
You're able to eliminate duplicate identical sections using AHK's Sort command (preferably done at the clipboard's content). Unfortunately, those returned two sections aren't identical (I had to be advised myself by my fellow German @haichen to spot the difference! And yes, it's about an error). :mrgreen:
So you have to rethink your conditions and/or the data consistency of your source (files).
Hi BNOLI,

I found @haichen's post, can I ask @haichen in your post? Thanks for help.

BNOLI
Posts: 548
Joined: 23 Mar 2020, 03:55

Re: How can I copy a text from notepad?

Post by BNOLI » 28 Apr 2020, 22:49

I guess you can, but, you haven't answered the question about your datas consistency in the first place, and how you wanna deal with it?
Remember to use [code]CODE[/code]-tags for your multi-line scripts. Stay safe, stay inside, and remember washing your hands for 20 sec !

Marcosa1020
Posts: 160
Joined: 23 Sep 2015, 19:15

Re: How can I copy a text from notepad?

Post by Marcosa1020 » 28 Apr 2020, 23:49

BNOLI wrote:
28 Apr 2020, 22:49
I guess you can, but, you haven't answered the question about your datas consistency in the first place, and how you wanna deal with it?
Hi BNOLI,

I can explain with instructions, please let me know If I have answer the question.

If the content as below.

Field_A, C#1, D#2
Field_B
Item1 Item2 Item3 Item4 Item5 Item6 Item7
300.1 1000 A 1500 1800 Coni AKFJ
300.2 2000 A 2500 2800 Coni FJRO
300.3 3000 A 3500 3800 Coni EI
300.4 4000 B 4500 4800 Coni DJS
300.5 5000 B 5500 5800 Coni PEJ
300.6 6000 C 6500 6800 Coni ERE
300.7 7000 C 7500 7800 Coni HFK

Field_A, C#2, D#4
Field_B
Item1 Item2 Item3 Item4 Item5 Item6 Item7
300.1 1000 A 1500 1800 Coni AKFJ
300.2 2000 A 2500 2800 Coni FJRO
300.3 3000 A 3500 3800 Coni EI
300.4 4000 B 4500 4800 Coni DJS
300.5 5000 B 5500 5800 Coni PEJ
300.6 6000 C 6500 6800 Coni ERE
300.7 7000 C 7500 7800 Coni HFK
300.8 8000 C 8500 8800 Coni HKE


I hope to get the content when I select C#1, D#2 and C#2, D#4.

Field_A, C#1, D#2
Field_B
Item1 Item2 Item3 Item4 Item5 Item6 Item7
300.1 1000 A 1500 1800 Coni AKFJ
300.2 2000 A 2500 2800 Coni FJRO
300.3 3000 A 3500 3800 Coni EI
300.4 4000 B 4500 4800 Coni DJS
300.5 5000 B 5500 5800 Coni PEJ
300.6 6000 C 6500 6800 Coni ERE
300.7 7000 C 7500 7800 Coni HFK

Field_A, C#2, D#4
Field_B
Item1 Item2 Item3 Item4 Item5 Item6 Item7
300.1 1000 A 1500 1800 Coni AKFJ
300.2 2000 A 2500 2800 Coni FJRO
300.3 3000 A 3500 3800 Coni EI
300.4 4000 B 4500 4800 Coni DJS
300.5 5000 B 5500 5800 Coni PEJ
300.6 6000 C 6500 6800 Coni ERE
300.7 7000 C 7500 7800 Coni HFK
300.8 8000 C 8500 8800 Coni HKE


If the content as below.

Field_A, C#1, D#2
Field_B
Item1 Item2 Item3 Item4 Item5 Item6 Item7
300.1 1000 A 1500 1800 Coni AKFJ
300.2 2000 A 2500 2800 Coni FJRO
300.3 3000 A 3500 3800 Coni EI
300.4 4000 B 4500 4800 Coni DJS
300.5 5000 B 5500 5800 Coni PEJ
300.6 6000 C 6500 6800 Coni ERE
300.7 7000 C 7500 7800 Coni HFK

Field_A, C#1, D#2
Field_B
Item1 Item2 Item3 Item4 Item5 Item6 Item7
300.1 1000 A 1500 1800 Coni AKFJ
300.2 2000 A 2500 2800 Coni FJRO
300.3 3000 A 3500 3800 Coni EI
300.4 4000 B 4500 4800 Coni DJS
300.5 5000 B 5500 5800 Coni PEJ
300.6 6000 C 6500 6800 Coni ERE
300.7 7000 C 7500 7800 Coni HFK
300.8 8000 C 8500 8800 Coni HKE


I hope to get the content when I select C#1, D#2.

Field_A, C#1, D#2
Field_B
Item1 Item2 Item3 Item4 Item5 Item6 Item7
300.1 1000 A 1500 1800 Coni AKFJ
300.2 2000 A 2500 2800 Coni FJRO
300.3 3000 A 3500 3800 Coni EI
300.4 4000 B 4500 4800 Coni DJS
300.5 5000 B 5500 5800 Coni PEJ
300.6 6000 C 6500 6800 Coni ERE
300.7 7000 C 7500 7800 Coni HFK
300.8 8000 C 8500 8800 Coni HKE

BNOLI
Posts: 548
Joined: 23 Mar 2020, 03:55

Re: How can I copy a text from notepad?

Post by BNOLI » 29 Apr 2020, 00:42

Well, we'll have a duplicate if every part is exactly the same. In your 2nd sample, the 'header' (C#1, D#2) of those sections are the same, but not the number of lines, therefore it isn't a duplicate, and for that reason :arrow: Sort won't skip one of it. In your previous sample, the header was the same, the number of lines was the same, but a single item (where it said 'Error' instead of 'Coni') wasn't the same. So finally, you have to think about all events where it's fine for you to ignore differences within these sections and change the filtering conditions accordingly.

Tipp, if you create a (new) thread/request for single steps/parts of your whole project, you'll attract additional supporters to deal with it. That will speed up things!
Remember to use [code]CODE[/code]-tags for your multi-line scripts. Stay safe, stay inside, and remember washing your hands for 20 sec !

Marcosa1020
Posts: 160
Joined: 23 Sep 2015, 19:15

Re: How can I copy a text from notepad?

Post by Marcosa1020 » 29 Apr 2020, 00:53

BNOLI wrote:
29 Apr 2020, 00:42
Well, we'll have a duplicate if every part is exactly the same. In your 2nd sample, the 'header' (C#1, D#2) of those sections are the same, but not the number of lines, therefore it isn't a duplicate, and for that reason :arrow: Sort won't skip one of it. In your previous sample, the header was the same, the number of lines was the same, but a single item (where it said 'Error' instead of 'Coni') wasn't the same. So finally, you have to think about all events where it's fine for you to ignore differences within these sections and change the filtering conditions accordingly.

Tipp, if you create a (new) thread/request for single steps/parts of your whole project, you'll attract additional supporters to deal with it. That will speed up things!
Hi BNOLI,

Thank you so much !!!

Post Reply

Return to “Ask For Help”