Capture specify data from text

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
tengounamigo
Posts: 5
Joined: Fri Jun 11, 2010 7:13 am

Capture specify data from text

Post by tengounamigo »

hello all,

my question is if its possible to capture a concrete data from txt.

for example I have this txt.


GROUP=PEPAPEA AUTH=USE CONNECT-OWNER=PEPPEPEPE
CONNECTS=10,683 UACC=NONE LAST-CONNECT=09.215/18:57:44
CONNECT ATTRIBUTES=NONE

How I can capture all the variables that contains GROUP= (in this case PEPAPEA)

Is possible ??
ak47wong
Posts: 703
Joined: Tue Aug 12, 2003 9:37 am
Location: Sydney, Australia

Post by ak47wong »

Possibly, but what do you mean by capture? Where do you want to capture it to? Do you want to transform the source text to something else?

Andrew
User avatar
SteveH
Posts: 327
Joined: Thu Apr 03, 2003 11:37 am
Location: Edinburgh, Scotland
Contact:

Post by SteveH »

It would help if you can post an example showing the BEFORE and AFTER text you would want.
Running TextPad 5.4 on Windows XP SP3 and on OS X 10.7 under VMWare or Crossover.
tengounamigo
Posts: 5
Joined: Fri Jun 11, 2010 7:13 am

Post by tengounamigo »

hello! and thanks for the interest :)

I try to explain me better. (and sorry for my english)

for expample:

after text:

fdkjshfjdskf
fkjdslkfjklds
fdkjdlsfklsdkñf
kdlfskñlfkñlds
GROUP=123445
dflkjls
fjkldsfjkldsj
dfjsklfjkld
GROUP=1111111
kdjfks
dsfjkjf
GROUP=1aaaaa
fjdskfjkldsj


before:
123445
1111111
1aaaaa


if not possible, with this is ok:
GROUP=123445
GROUP=1111111
GROUP=1aaaaa



I want to capture all Group=* contents.


Thank you.
ben_josephs
Posts: 2459
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

I suspect you have your after and before labels the wrong way around.

Here's one way to do what you want.

Use Posix regular expression syntax:
Configure | Preferences | Editor

[X] Use POSIX regular expression syntax
1. Bookmark all the lines containing a GROUP=value pair:
Search | Find... (<F5>):
Find what: \<GROUP=

[X] Regular expression

Mark All
2. Copy the bookmarked lines into the paste buffer:
Edit | Copy Other | Bookmarked Lines

3. Open a new document and paste the lines there.

4. If there's only one GROUP=value pair on any line use
Find what: .*\<GROUP=([^ ]+).*
Replace with: \1

[X] Regular expression

Replace All
tengounamigo
Posts: 5
Joined: Fri Jun 11, 2010 7:13 am

Post by tengounamigo »

thank you very much !!!!!!!!! :)
Sam13
Posts: 1
Joined: Sat Jul 31, 2010 6:22 am

Post by Sam13 »

Thank you too..
Cheers everyone...
Post Reply