Hi,
If I have 2 arrays and one has (say) 10 names(as entries)and the other has the same 10 names + 2 more new ones, what short code can help me pick out the 2 new names in the 2nd file ?
Thanks
User Profile
Collapse
-
pick out the differing entries between 2 files
-
Thank for all those who helped.My code that I posted earlier to create a hash of hash of hash worked.
Code:(keys{$ blocks{$inputs}{$outputs}}) -
-
Thanks
Thanks. I shall give it a shot..also I tried this rough code.Is this okay ?
...Code:# check if line starts with "delay" if ($line =~ /^delay/) { # regular expression to get the inputs & outputs $line =~ m/\-from\s+\[\s+(.*)\]\s+\-to\s+\[\s+(.*)\]/; # inputs & block information $in = $1; @in1 = split(/\//, $in); $blockin = $in1[0];Leave a comment:
-
Appreciate the help offered.Also for trying to correct my ways in the other forum.Leave a comment:
-
I'm sorry to to not have thanked the posters earlier.Appreci ate the helpLeave a comment:
-
hash of a hash
I have this info' in a file.
blockA/input1 to block A/output1 delayXX
blockA/input1 to blockA/output2 delayYY
blockA/input1 to blockA/output3 delayZZ
blockB/input1 to blockB/output1 delayPP
blockC/input1 to blockC/output1 delayQQ
blockC/input2 to blockC/output1 delayRR
how to store the inputs and outputs for each block as shown above ? in 2 hashes or arrays ? I am not... -
copying more than one line to another file
When I read file A , it has these lines like that need to be reproduced:
Input a, b, c,
X,Y;
Output m,n
, f,g;
How do I reproduce this in the new file ?
Basically when I read “file A” line by line, I search for first word and if it’s “input” I need to start copying from there till the semicolon... -
copy a file
Hi,
I want to do a backup of a file from one area where I don't have write permission onto my area where I do have write permission ?How to do it ?
do I do a copy first and then a rename ? if so how -
code for a simpler example
Note: This could be the code if the content was one line each and the keyword was enclosed(2nd word in ech line) as part of that line.But what I need is if that key word is separate line as mentioned in the original question and there is more than one line below the keyword.
...Code:## assuming below is how file1.txt looks like ## ## For Indicators, please visit b.x.com.
Leave a comment:
-
search string in a file and print
Hi,
I have a file which has contents like this :
Indicators :
for issues with indicators contact a@x.com
for access to indicators contact b@x.com
Unix_Versions :
for latest unix versions check out u.versions.com/new.html
for past versions please see u.versions.com/old.html
-----------------
The keywords are...
No activity results to display
Show More
Leave a comment: