from the above example we take one record (bd-integ4-sarkprime,IN,NS,gss-t2i.is.sark.com.,,,,) ( for example) strip it and it should result as:
bd-integ4-sarkprime
and
gss-t2i.is.sark.com
The script should then look for bd-integ4-sarkprime and gss-t2i.is.sark.com in the 3 files (exportOBJ-sark.txt","ResourceRecText-ALL.txt","exportdnsrr-report.txt)
(BTW..The format above will not change.)
Then I want it to search inside 3 files for any matches to bd-integ4-sarkprime and gss-t2i.is.sark.com to report on it. called
exportOBJ-sark.txt
(example of contents)
10.0.234.254,cli2821cncx-stmin-00-01,,,is.sark.com,Server,"",,,,,-1,0,,,-1,,3,,
10.0.237.254,cli2821cncx-tgsp-00-01,,,is.sark.com,Server,"",,,,,-1,0,,,-1,,3,,
For "exportOBJ-sark.txt" I can remove the ",,," manually before running the script so it can join as cli2821cncx-stmin-00-01.is.sark.com, or if the script can do that?
ResourceRecText-ALL.txt
(example of contents)
outputRR-sark.com.txt:ResourceRecText=whdgss1infz-qapri1.is.sark.com.
outputRR-sark.com.txt:ResourceRecText=n3mgss1infz-qasec1.is.sark.com.
exportdnsrr-report.txt
(example of contents)
srsservicing.net,sarkprivate.srsservicing.net,IN,A,-1,100.168.67.190,,,0,0,"",""
srsservicing.net,sarkmanagedcontrolprivate.srsservicing.net,IN,A,-1,100.168.67.189,,,0,0,"",""
Can I get some help to tune this up please.
Thanks
Last edited by richsark; 05-14-2009 at 09:44 AM..
Reason: clairifcation
hard to say because in the files you want to search, there are no matches for the search terms at all.
here are the files to search:
here are you sample search terms:
bd-integ4-sarkprime
gss-t2i.is.sark.com.
I don't see either of those search terms in the search files. I see a partial match of 'is.sark.com' but you did not say you want to find partial matches. So unless you can clarify better I don't want to spend any time trying to help.
I have existing pattern in the perl script as:
my $pattern = "^Line.*?:|^Errors*: |^SEVERE:.*?:|^Null pointer exception occurred";
and I wanted to include below keywords in my search pattern
"I/O exception" and "FileNotFoundException"the problem is when I include my pattern like
my... (5 Replies)
Hi,
I have a string like:
read_lib {$lib/a.lib $lib/b.lib $lib/c.lib ..... }
Now, I want to search existence of all these *.lib files in $lib directory.
Please suggest- how to do it.
Thanks
-rkg (2 Replies)
Hi,
I want the Perl script with versions 5.8.2 and 5.8.5 starting with
#!/usr/bin/perl
The Perl program should read the excel file or text file line by line and taking into an array and search in the UNIX directories for reference file of .jsp or .js or .xsl with path .The Object names... (2 Replies)
hi,
i have one file as t1.txt as below
hi
hello
welcome
i want perl script to search for the pattern "abcd" in the file.
if the pattern doesn't exist, i want to insert that pattern at the end of the same file t1.txt
my o/p should be
hi
hllo
welcome
abcd
thank you (3 Replies)
Good evening All,
I have a perl script to pull out all occurrences of a files beginning with xx and ending in .p. I will then loop through all 1K files in a directory. I can grep for xx*.p files but it gives me the entire line. I wish to output to a single colum with only the hits found. ... (3 Replies)
Dear all,
I am new to perl script and would need some help for my 1st script. I wrote a script to search sprintf(buf,"%s", sourcestring) and replace with snprintf(buf, sizeof(buf),"%s", sourcestring). As snprintf() requires an extra argument, so it is not a simple search-and-replace. I need to... (1 Reply)
I am using perl to perform a search and replace. It works at the command line, but not in the csh shell script
perl -pi -e 's@/Pattern@@g' $path/$file
I used the @ as my delimiter because the pattern contains "/" (3 Replies)
I wanted a perl script to be done for Password search & replace in two files.
For Example:
Example 1)--i am having a file such as
cat /opt/customer/Ariba/UAT/ariba/app/buyer/Server/config/Parameters.table
Example 2)--and i am having a other file in other location such as cat... (4 Replies)
i have to point out that i'm a avid shell script lover and i have next to zero interest in perl which is why i dont know the first thing about it. however, just need to do this one thing on it..
i need to do something in perl but dont know how. I have a list of email addresses in the following... (5 Replies)
Hello,
I have a requirement to search a directory, which contains any number of other directories for file names that contain special characters.
directory structure
DIR__
|__>DIR1
|__>DIR2__
|__>DIR2.1
|__>DIR2.2
|__>DIR3
..
... (8 Replies)