I am in need of some help on changing the way I am used to parsing some data. I have no problem getting the data I want from a file, but what I want this time is for the script to tell me what systems are missing a certain string of data. Once again I am in over my head and cannot figure this one out. I have tried to use regular expressions with an “if” loop to no avail to get the output I would like. Here is some sample data.
File one: One.log (input)
Computer1
KB893756
KB896422
KB896423
KB899588
KB899591
KB921883
Computer2
KB893756
KB896422
KB896423
KB899591
KB917159
KB921883
Computer3
KB893756
KB896422
KB899588
KB899591
KB917159
KB921883
This is the parsed data I am able to get myself from a much larger file. What I would like to do now is to check each grouping against a list and have it tell me which patch a computer does not have in it’s list. The list of patches on each computer is not set to a certain amount, it can and will change in what is does and does not have.
File two: Two.txt (input, patch list)
KB893756
KB893803
KB896422
KB896423
KB899588
KB899591
KB911927
KB921883
Could I get some help on how someone would go about doing this? If you do not feel like doing it for me, please get me started with some specific pointers if you are willing.
I need this outputted to a new file, and the patch list does not have to be a file if that is easier, but other patches will be added to the document as we need them there.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.