Delete lines when first fields match.

Get help with installation and running here.

Moderators: DataMystic Support, Moderators

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

Delete lines when first fields match.

Postby WzevGIlK » Sat Mar 20, 2010 3:04 am

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: 2154
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Delete lines when first fields match.

Postby DataMystic Support » Mon Mar 22, 2010 10:59 am

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
Regards,

Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments

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

Re: Delete lines when first fields match.

Postby WzevGIlK » Sun Mar 28, 2010 9:43 pm

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


Return to “TextPipe Tips and Tricks, Questions and Support”

Who is online

Users browsing this forum: No registered users and 1 guest