+ Reply to Thread
Results 1 to 13 of 13

Newb: Need help formatting a script output

  1. #1
    Registered User
    Join Date
    05-25-2013
    Location
    Houston, TX
    MS-Off Ver
    Microsoft Office 2010
    Posts
    8

    Cool Newb: Need help formatting a script output

    Hi Excel Forum!

    Newb here. Hope you can help me. TIA.


    I'm a network administrator and I've got a few hundred servers who i think are missing hotfixes. 792 servers, 56 possible missing hotfixes.

    I'm using a PowerShell script to ping each server for the hotfixes, then if the hotfix isn't installed write to the output file.

    My output txt file looks like this:


    Server1
    KB1234
    KB2345
    KB3456
    KB4567
    KB5678
    KB6789
    Server2
    KB1234
    KB2345
    KB3456
    KB4567
    Server3
    KB2345
    KB3456
    KB4567
    KB5678
    KB6789
    Server4
    KB1234
    KB2345
    KB3456
    KB4567
    KB5678
    KB6789


    With 792 servers and 56 possible missing hotfixes......my output file is huge and unmanageable as a never ending list. I want to pull this ridiculous list into excel and format it so management can comprehend this problem. I'm not set on any particular format, in fact i'm open to suggestions. Hell, anything is better than what I've currently got. I'm far far from an excel guru, but am familiar with basic features and formulas. If someone could help me get this output formatted, I would forever be in there debt.

    So, i've come here seeking the help of the Excel Forum.


    Thanks in Advance.
    Last edited by Klark Kent; 05-28-2013 at 04:34 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    06-16-2006
    Location
    Sydney, Australia
    MS-Off Ver
    2013 64bit
    Posts
    1,394

    Re: Newb: Need help formatting a script output

    You should format your data in a table, then create a pivot table over the top. From there you can do anything.

    Ideally, get your script to produce data in the format

    Server1,KB1234
    Server1,KB2345
    Server2,KB1234
    Server2,KB2345


    etc.

    Then put a pivot table over the top.

    I will produce a macro that formats you existing data this way and post it shortly.
    My approach to providing help is to help you to help yourself. So my answers won't always solve your problem, but hopefully you can learn enough to solve the problem yourself and be more self sufficient for the experience.

  3. #3
    Valued Forum Contributor
    Join Date
    06-16-2006
    Location
    Sydney, Australia
    MS-Off Ver
    2013 64bit
    Posts
    1,394

    Re: Newb: Need help formatting a script output

    Here is a sheet that will convert your data. Just paste the data into the input sheet and press the button. The converted data will be on the output page. See the sample pivot table contained within. Once your data is in the right format, select the new table you created and then goto INSERT\PIVOT TABLE. Accept the defaults.

    Then On the right hand side, drag the Server field to the row heading box, and the Patch field to the Sum Values box.

    One good thing about pivot tables, is you can then swap the fields around, and get the number of servers that need each patch.
    Attached Files Attached Files
    Last edited by Mallycat; 05-26-2013 at 12:22 AM.

  4. #4
    Registered User
    Join Date
    05-25-2013
    Location
    Houston, TX
    MS-Off Ver
    Microsoft Office 2010
    Posts
    8

    Re: Newb: Need help formatting a script output

    Thank you MallyCat! Let me go give that a shot.

  5. #5
    Registered User
    Join Date
    05-25-2013
    Location
    Houston, TX
    MS-Off Ver
    Microsoft Office 2010
    Posts
    8

    Re: Newb: Need help formatting a script output

    Hi Mally!

    It works brilliantly. more than i could've hoped for. Thank you soo much.


    One slight problem. 32990 lines of output from my script. I paste the result into excel press the "button 1" macro and it appears to be calculating.

    Is it possible for it to be too big or am I just being impatient.


    I have a great home computer. i7. 8GB of RAM. SSD OS drive.

  6. #6
    Valued Forum Contributor
    Join Date
    06-16-2006
    Location
    Sydney, Australia
    MS-Off Ver
    2013 64bit
    Posts
    1,394

    Re: Newb: Need help formatting a script output

    There is no way Excel or your PC wont handle that. It could be getting stuck on something, but I would have to look at the data. Try breaking the code by pressing control break on your keyboard

  7. #7
    Registered User
    Join Date
    05-25-2013
    Location
    Houston, TX
    MS-Off Ver
    Microsoft Office 2010
    Posts
    8

    Re: Newb: Need help formatting a script output

    Hmmm, i decided to about a quarter of the list since it wouldn't ever finish.
    And still the same result. Just the Windows loading pinwheel.


    How is the macro setup? is it using the key letters "server"?
    Because my actual servers aren't Server1, Server2, Server3.

    They are in a naming convention: SiteCode - Server Type - Number


    so, like ALATSS12, NYYTSS23, LAATSS34.

    ...but they do all contain the 3 letters "tss"

  8. #8
    Registered User
    Join Date
    05-25-2013
    Location
    Houston, TX
    MS-Off Ver
    Microsoft Office 2010
    Posts
    8

    Re: Newb: Need help formatting a script output

    .....mally?

  9. #9
    Registered User
    Join Date
    05-25-2013
    Location
    Houston, TX
    MS-Off Ver
    Microsoft Office 2010
    Posts
    8

    Re: Newb: Need help formatting a script output

    BUMP. Anyone else?

  10. #10
    Valued Forum Contributor
    Join Date
    06-16-2006
    Location
    Sydney, Australia
    MS-Off Ver
    2013 64bit
    Posts
    1,394

    Re: Newb: Need help formatting a script output

    I can only give you advice based on the sample data you provide. If you post all the data, I can take another look.

  11. #11
    Registered User
    Join Date
    05-25-2013
    Location
    Houston, TX
    MS-Off Ver
    Microsoft Office 2010
    Posts
    8

    Re: Newb: Need help formatting a script output

    Hi Mally,


    I appreciate all your help. I'm just not comfortable posting server names or hotfix #'s.


    I can assure you the data is formatted like such tho:


    ALATSS001
    KB1234
    KB2345
    KB3456
    KB4567
    KB5678
    KB6789
    MISTSS001
    KB1234
    KB2345
    KB3456
    KB4567
    FLATSS001
    KB2345
    KB3456
    KB4567
    KB5678
    KB6789
    ARKTSS001
    KB1234
    KB2345
    KB3456
    KB4567
    KB5678
    KB6789


    all the servers have the 3 letters TSS in the naming convention.

  12. #12
    Registered User
    Join Date
    05-25-2013
    Location
    Houston, TX
    MS-Off Ver
    Microsoft Office 2010
    Posts
    8

    Cool Re: Newb: Need help formatting a script output

    I fixed it!

    sub formatdata()
    dim myserver as string
    dim mykb as string


    application.screenupdating = false

    range("a1").select
    sheets("output").activate
    range("a1").currentregion.delete
    range("a1").value = "server"
    range("b1").value = "patch needed"
    range("a2").select
    sheets("input").activate

    while selection.value <> ""
    if instr(selection.value, "tss") then
    myserver = selection.value
    selection.offset(1, 0).select
    while instr(selection.value, "kb")
    mykb = selection.value
    sheets("output").activate
    activecell.value = myserver
    activecell.offset(0, 1).value = mykb
    activecell.offset(1, 0).select
    sheets("input").activate
    activecell.offset(1, 0).select
    if selection.value = "" then goto exithere:
    Wend
    end if
    wend
    exithere:
    Application.screenupdating = true
    end sub

  13. #13
    Valued Forum Contributor
    Join Date
    06-16-2006
    Location
    Sydney, Australia
    MS-Off Ver
    2013 64bit
    Posts
    1,394

    Re: Newb: Need help formatting a script output

    Ok, good......

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1