Hello,
I want to search two strings in a file and print the same in the new file using perl script.
Can anyone suggest me how to do this...
The file looks like below:
<UML:ModelElement.requirement>
<UML:Dependency name="Row_MainColumn_FW_0009"> <UML:ModelElement.taggedValue>
<UML:Requirement="Column_MainRow_FW_0010">
I want to search the string start with ROW_ or Column_
Any suggestion on this
suvendu4urs:
Hello,
I want to search two strings in a file and print the same in the new file using perl script.
Can anyone suggest me how to do this...
The file looks like below:
<UML:ModelElement.requirement>
<UML:Dependency name="Row_MainColumn_FW_0009"> <UML:ModelElement.taggedValue>
<UML:Requirement="Column_MainRow_FW_0010">
I want to search the string start with ROW_ or Column_
Any suggestion on this
perl -ne 'print "$1\n" if /((?:ROW|COLUMN)_\w+)/' $filename
That works...
Thanks a lot
---------- Post updated at 04:00 AM ---------- Previous update was at 03:23 AM ----------
One more question:
How can i print the whole line in this case:
If any line contains ROW_ or Column_ print the whole line:
The output shall be like this:
<UML:Dependency name="Row_MainColumn_FW_0009">
<UML:Requirement="Column_MainRow_FW_0010">
perl -ne 'print if /(?:ROW|COLUMN)_/' $filename