Hi,
I have a situation where I am comparing a bunch of text files and I want to ignore lines containing certain text strings. Also, perhaps ignore the first N lines of the file. I suppose there must be a simple RegEx answer to this, but so far it eludes me. For instance, I want to ignore lines that contain:
"CK SUM:"
"DIRECTORY:"
and possibly another 5 to 10 character strings. Any help greatly appreciated.
TIA,
Bill
ignoring lines with certain content
Re: ignoring lines with certain content
Hi Bill,
To add more strings to the regular expression, simply add the strings (escaping all necessary characters) and separate them all with | operators.
Regards,
psguru
For this purpose you could use a regular expression like:For instance, I want to ignore lines that contain:
"CK SUM:"
"DIRECTORY:"
and possibly another 5 to 10 character strings.
Code: Select all
CK SUM\:|DIRECTORY\:
Unfortunately, this is not possible with regular expressions.Also, perhaps ignore the first N lines of the file.
Regards,
psguru
psguru
PrestoSoft
PrestoSoft
Re: ignoring lines with certain content
The problem that you are facing here is that examdiff pro run your regex in line by line mode.
What you are asking for is a multiline functionality where an expression like below would ignore a complete C# documentation tag. This is as stated earlier not possible. If you have multiple rows that you want to ignore you need to ignore them one by one. Unfortunately this means that you can't ignore a line depending on the contents of an earlier line.
^[ \t]*/// <summary>(?:[^/]*/)*?// </summary>[^\n]*\n
What you are asking for is a multiline functionality where an expression like below would ignore a complete C# documentation tag. This is as stated earlier not possible. If you have multiple rows that you want to ignore you need to ignore them one by one. Unfortunately this means that you can't ignore a line depending on the contents of an earlier line.
^[ \t]*/// <summary>(?:[^/]*/)*?// </summary>[^\n]*\n
Re: ignoring lines with certain content
Thanks psguru,
A follow-up detail. I assume the RegEx's go into the Text Comparison Options/Ignore parts of each line?
TIA,
Bill
A follow-up detail. I assume the RegEx's go into the Text Comparison Options/Ignore parts of each line?
TIA,
Bill
Re: ignoring lines with certain content
No, this is for Options | Compare | Ignore lines matching regular expression.A follow-up detail. I assume the RegEx's go into the Text Comparison Options/Ignore parts of each line?
psguru
PrestoSoft
PrestoSoft
Re: ignoring lines with certain content
This is actually incorrect. EDPro can use multiline regexes as "comments". See Options | Document Types. There you can define a type with its "comment" to ignore, which is just a multiline regex (can be a single line as a special case, of course).tofuse wrote:The problem that you are facing here is that examdiff pro run your regex in line by line mode.
psguru
PrestoSoft
PrestoSoft
Re: ignoring lines with certain content
For this you should pass your files through a command line Unix-like command:BillG wrote:...ignore the first N lines of the file...
Code: Select all
tail +3 YourFile.txt