PDA

View Full Version : Data compare - filter by recordtype


Regressie
21-Oct-2008, 01:52 PM
Is it possible to filter lines by a recognizing a character that represents the recordtype?

For example I have 2 types of lines in my data file:
"1-asd-asd-asd-asd-asd" and
"2-asdfe--asdfe--asdfe--asdfe--asdfe"
where the 1 and the 2 (pos 1 of every line) determine the format characteristics of the line.

Is it possible to perform a compare only on the lines that start with a "1"?

Thanks in advance!

Michael Bulgrien
22-Oct-2008, 09:19 PM
Absolutely,

Go to Tools\File Formats...
Click New..., click OK to create a new Text Format
Give your new file format a name and specify a file mask if you wish (optional)
Click on the Grammar tab
Click New..., give your new element a name describing the record type
Choose the Lines category and use a Regular expression
Enter ^1 in the "Text matching" field and set the "next" spinbox to 0
(the caret indicates that the expression begins at the start of a line)
Click OK, Save, Close

When back in the text compare, choose your new file format in the "File Info" header on both sides
(If the File Info header is not visible, select it from the View dropdown menu)
Click on Session Settings (referee icon), choose the Importance tab
Make sure your record type gammar element is checked to make it important
Uncheck the Everything Else checkbox, click OK
Click the Ignore Unimportant Differences button on the toolbar (≈)

Regressie
03-Nov-2008, 05:44 AM
Thank you for your answer.

Actually I was trying to refer to the Data Compare instead of the Text Compare. Do you know if it is also possible in the Data Compare section? It would really help.

Craig
03-Nov-2008, 03:47 PM
Sorry, the data compare doesn't support this natively. If you're able to, you could handle this by converting the files to CSV externally and stripping out the '2' lines. You could then plug that into the file format as an external conversion.

Regressie
04-Nov-2008, 07:21 AM
Is it something that could be built in, in a newer version, perhaps? :)

Craig
04-Nov-2008, 01:45 PM
I can add it to the wishlist, but I wouldn't expect it anytime soon.

Regressie
05-Nov-2008, 04:45 AM
Alright, that would be great, thank you.