Hi,
I have a program written in awk and I want to extend it to do another task.
My program is a list of CVS log reports of a repository. For each file, I have some fields. One of the fields is the comment field. I want to know how I can check if a comment (which is a free text field) contains a number and if it does, I want to check if that number exists in another list of numbers (taken as input from another file).
For example,
If the list of numbers is
100
101
102
103
And I have the following log data
RCS file: /cvsroot/eclipse/org.eclipse.jdt.apt.core/src/org/eclipse/jdt/apt/core/internal/util/SourcePositionImpl.java,v
head: 1.10
branch:
locks: strict
access list:
keyword substitution: kv
total revisions: 12; selected revisions: 1
description:
=============================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.apt.core/src/org/eclipse/jdt/apt/core/internal/util/TypesUtil.java,v
head: 1.13
branch:
locks: strict
access list:
keyword substitution: kv
total revisions: 15; selected revisions: 2
description:
----------------------------
revision 1.13
date: 2008-01-01 20:28:39 -0600; author: wharley; state: Exp; lines: +1 -16; commitid: 537d477af6d64567;
Bug 100 - partial fix.
=============================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.apt.core/src/org/eclipse/jdt/apt/core/internal/util/Visitors.java,v
head: 1.7
branch:
locks: strict
access list:
keyword substitution: kv
total revisions: 8; selected revisions: 1
description:
=============================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.apt.core/src/org/eclipse/jdt/apt/core/util/AptPreferenceConstants.java,v
head: 1.16
branch:
locks: strict
access list:
keyword substitution: kv
total revisions: 17; selected revisions: 4
description:
----------------------------
revision 1.16
date: 2008-01-29 16:55:45 -0600; author: wharley; state: Exp; lines: +1 -1; commitid: 69f6479faef04567;
This is also some sample text. bug 101, followed by some more text.
----------------------------
revision 1.14
date: 2007-10-15 15:46:44 -0500; author: wharley; state: Exp; lines: +12 -1; commitid: 724c4713d1b24567;
This is some sample text. Bug 102: some text
=============================================================================
After the word "description", there can be 0, 1 or more commit data. In each commit data, I want to get the number from it, which can be anywhere in the 3rd or 4th line after the field separator "----------". And I want to compare that number with the list above and if it turns to be true, take some actions.
Can anyone help me how to do this. If needed, I can also send the already existing awk code I have.
Thanks,
Sandeep