to delete alternatively

General questions about using WildEdit

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

Post Reply
look4kannan
Posts: 6
Joined: Fri Oct 06, 2006 3:38 pm

to delete alternatively

Post by look4kannan »

hi iam new to wildedit

whats the easiest way to delete all lines(everything) untill special word comes(delete including that)

example

12 12 12 12 12 12

12 12 12 12 12 12

12 12 12 12 12 12 22 xx a1 a2 a3 a4 a5 a6 yy c1 c2 xx zz

12 12 12 12 12 12

12 12 12 21 12 12

12 12 12 12 12 12 xx b7 b8 b9 b0 b1 b2 yy zz c3 c4 yy


final result should be

123456

789012

task is to delete everything untill 'xx' comes(including xx),(xx should be first xx in the line)
and then to delete one space and one character or numeric
untill 'yy' comes (including yy)

this should be edited for 1000's of lines

please help me
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

Playing back what you need in other words:

Keep everything between xx and yy, drop the xx and yy, and remove first letter of each word, and the spaces that remain on what remains.

Is that correct?

I suspect that this may need to be done in multiple passes, will that be OK?
Hope this was helpful.............good luck,
Bob
look4kannan
Posts: 6
Joined: Fri Oct 06, 2006 3:38 pm

hi

Post by look4kannan »

i need need the commands for that please
look4kannan
Posts: 6
Joined: Fri Oct 06, 2006 3:38 pm

hi

Post by look4kannan »

u know iam new to wild edit!!!!!!!!

i need step by step procedure to edit that file
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

There is probably an easier method, but this worked on the sample you provided. Using TextPad tools, not WildEdit.

Multiple passes, Check box in Regular Expressions, Editor using POSIX
Ignore quote symbols ("), use values inside the quotes.
All Replace settings use Active Document.
May want to make a copy of document after each step in case of errors.
================================
Start here
1. Find Mark All with "^.*xx(.*)"
2. Search/Invert All Bookmarks
3. Edit/Delete/Bookmarked Lines
Now only have the lines to be processed
4. Search/Replace "^.*xx(.*)yy.*" with \1
5. Search/Replace "yy.*\n" with \n
6. Search/Replace "[a-z]" with nothing
7. Search/Replace "[[:space:]]" with nothing
=====================
Result is:
123456
789012
Hope this was helpful.............good luck,
Bob
look4kannan
Posts: 6
Joined: Fri Oct 06, 2006 3:38 pm

hi

Post by look4kannan »

sorry to distrub u again.
ur information is very helpful for me
thankyou verymuch for ur help
i forgot to ask u b4

example

12 32 13 45 aa 65 98 65

54 21 54 32 21 87 98



65 54 21 65 aa 54 87 01 02

result

2235a585

5415a4712

(i.e line which dont have 'aa' should be deleted entierly
then first character or number of all should be deleted
lastly i need to align all lines with 1 line spacing)
look4kannan
Posts: 6
Joined: Fri Oct 06, 2006 3:38 pm

hi

Post by look4kannan »

now iam able to delete lines without aa

i just want help to delete two spacing after the first one

example

12 12 12 12 32 32 54

54 65 65 65 65 65 65

result

2222224

4555555
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

Starting with this:
12 12 12 12 32 32 54

54 65 65 65 65 65 65

Make two passes, ignoring the quotes ("):
1. Replace "^.{1}" with nothing
2. Replace " .{1}" with nothing (note the space at beginning)

Results with this:
2222224

4555555
Hope this was helpful.............good luck,
Bob
look4kannan
Posts: 6
Joined: Fri Oct 06, 2006 3:38 pm

hi

Post by look4kannan »

thank u so much 4 ur help

lastly how to make 1 line spacing after each line

thanks for ur help again
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

Replace "\n\n" with "\n"

Ignore quotes
Hope this was helpful.............good luck,
Bob
Post Reply