Page 1 of 1

joining of the second part of the line

Posted: Sat Nov 18, 2006 1:22 am
by sardaukar22
I work with text that is made by lines separated in left and right part.

eg.

first part1==second part1
first part2==second part2
first part2==second part3
first part3==second part4

When first part is the same in the 2 lines or more, I need to join the second part of the next line with same first part with the previous line or

first part1==second part1
first part2==second part2, second part3
first part3==second part4

I guess it shoul use capture, but i don't know how? I will be thankfull if you can help me.

Posted: Tue Nov 21, 2006 6:39 am
by DataMystic Support
Use an EasyPattern to find

Code: Select all

[ capture( 1+ chars) , '==', capture( 0+ not cr or lf ), cr, lf,
  group1, '==', capture( 0+ not cr or lf ), cr, lf ]
replace with

Code: Select all

$1==$2, $3
You may need to add 3 copies of this search/replace to pick up 3/4/5 line repeats.

Posted: Fri Nov 24, 2006 11:22 pm
by sardaukar22
Thank you, for your help.

I made a change becuse in some documents doesn't recognize , cr, lf] in the last part of the filtre i simply put return (enter) key.

Posted: Fri Nov 24, 2006 11:28 pm
by sardaukar22
Wonderfull program!

Posted: Sun Nov 26, 2006 7:57 pm
by DataMystic Support
Thank you! Please recommend it to other people.