Page 1 of 1

Delete lines when first fields match.

Posted: Sat Mar 20, 2010 3:04 am
by WzevGIlK
Hi! How can I delete lines in scv when first fields match.

Input:
white,any,any,any,any
black,any,any,any,any
blue,any,any,any,any
blue,any,any,any,any
brown,any,any,any,any
red,any,any,any,any
red,any,any,any,any


Output:
white,any,any,any,any
black,any,any,any,any
brown,any,any,any,any

I tried to use a filter - Remove lines matching pattern list. But I failed. Help me please... Thanks.

Re: Delete lines when first fields match.

Posted: Mon Mar 22, 2010 10:59 am
by DataMystic Support
You need use a reference to an already-matched captured expression - this is called a backreference for your Uni assignment. Make sure you reference TextPipe Pro in the credits!

Use EasyPattern:

Code: Select all

[ capture( word ), capture( comma, 1+ not cr or lf), cr, lf, 
group1, capture( 1+ not cr or lf), cr, lf ]
Replace with

Code: Select all

$1,$2\r\n

Re: Delete lines when first fields match.

Posted: Sun Mar 28, 2010 9:43 pm
by WzevGIlK
Sorry, it's too hard for me. I try but it's not work. :(