Delete lines when first fields match.

Get help with installation and running here.

Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators

Post Reply
WzevGIlK
Posts: 10
Joined: Tue Mar 16, 2010 11:32 pm
Contact:

Delete lines when first fields match.

Post 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.
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Delete lines when first fields match.

Post 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
WzevGIlK
Posts: 10
Joined: Tue Mar 16, 2010 11:32 pm
Contact:

Re: Delete lines when first fields match.

Post by WzevGIlK »

Sorry, it's too hard for me. I try but it's not work. :(
Post Reply