Hi all,
I have a files with pipe delimited fields.
I`d like to delete lines which are duplicated in one field only.
I`ve been trying in several ways without result.
It seems that "delete duplicate lines" and "count duplicate lines" don`t work as a subfilter of "restrict fields"
Delete duplicate lines in a delimeted file
Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators
- DataMystic Support
- Site Admin
- Posts: 2227
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
Re: Delete duplicate lines in a delimeted file
No, as each text fragment passed to Delete duplicate lines is considered a new 'file'.
Are the lines with duplicate fields next to each other? If so, use an EasyPattern like this to identify them:
This will find lines where field1 is repeated on the next line.
This next EasyPattern finds lines where field 3 is repeated on the next line:
Are the lines with duplicate fields next to each other? If so, use an EasyPattern like this to identify them:
Code: Select all
[ capture( pipefield), pipe, capture( pipefield), pipe, capture( pipefield), pipe, cr, lf
group1, pipe ]
This next EasyPattern finds lines where field 3 is repeated on the next line:
Code: Select all
[ capture( pipefield), pipe, capture( pipefield), pipe, capture( pipefield), pipe, cr, lf
capture( pipefield), pipe, capture( pipefield), pipe, group3, pipe ]
Re: Delete duplicate lines in a delimeted file
thanks, it works
Re: Delete duplicate lines in a delimeted file
I have a similar question, is there a way to delete duplicate lines but leave the original line? When I do this it seems to remove even the original.leorr11 wrote:Hi all,
I have a files with pipe delimited fields.
I`d like to delete lines which are duplicated in one field only.
I`ve been trying in several ways without result.
It seems that "delete duplicate lines" and "count duplicate lines" don`t work as a subfilter of "restrict fields"
Last edited by JamesB on Fri Apr 07, 2017 11:57 pm, edited 1 time in total.
- DataMystic Support
- Site Admin
- Posts: 2227
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
Re: Delete duplicate lines in a delimeted file
Which version of TP do you have?
Is Filter Library\Remove\Duplicate lines your only filter?
Is Filter Library\Remove\Duplicate lines your only filter?