Report on data in CSV File that is older than dates provided

 Hello,
I have the following data in a csv file:
Server1 user1 8/12/2014 16:18
Server1 user2 3/21/2014 12:33
Server1 Admin 6/13/2013 15:34
Server2 user3 8/14/2014 7:34
Server2 Admin 11/14/2013 7:30
Server2 user4 8/12/2013 8:03
Server3 user5 8/14/2014 7:34
Server3 user1 7/14/2014 7:30
Server3 user3 6/12/2014 8:03
Server4 user5 8/14/2013 7:34
Server4 user2 6/12/2013 7:30
Server4 user3 2/12/2013 8:03
I'm hoping Powershell can help create csv reports of the following:
Report #1:
Create a CSV report of all Servers that have been logged into by users in the past 3 months and list in the report the users and times for each login in the past 3 months.  Basically for this report it would be to include the relevant lines from
the input and not report on logins older than 3 months (so multiple lines of login per server is that is what the input file had).
For this report I would expect to see the following output:
Server1 user1 8/12/2014 16:18
Server2 user3 8/14/2014 7:34
Server3 user5 8/14/2014 7:34
Server3 user1 7/14/2014 7:30
Server3 user3 6/12/2014 8:03
Report #2:
List all Servers that haven't been logged into in the past 3 months.  For this report I would expect to see only Server4.  I don't need to see the list of users for this report if that's possible.  So just a list of each server that has not
been logged into in the past 3 months.
Is this Something Powershell can do for me? Even if I have to create two scripts and run two scans to create two separate reports is fine. Where would I start with writing this type of script?
Thank you.

Yeah, each column in the CSV needs to have a descriptive header. Here's what I used to quickly test that example script I posted above:
loginDetails.csv:
Server,User,Date
Server1,user1,8/12/2014 16:18
Server1,user2,3/21/2014 12:33
Server1,Admin,6/13/2013 15:34
Server2,user3,8/14/2014 7:34
Server2,Admin,11/14/2013 7:30
Server2,user4,8/12/2013 8:03
Server3,user5,8/14/2014 7:34
Server3,user1,7/14/2014 7:30
Server3,user3,6/12/2014 8:03
Server4,user5,8/14/2013 7:34
Server4,user2,6/12/2013 7:30
Server4,user3,2/12/2013 8:03
Output of example from above:
Under 3 Months - Server1 user1 8/12/2014 16:18
Over 3 Months - Server1 user2 3/21/2014 12:33
Over 3 Months - Server1 Admin 6/13/2013 15:34
Under 3 Months - Server2 user3 8/14/2014 7:34
Over 3 Months - Server2 Admin 11/14/2013 7:30
Over 3 Months - Server2 user4 8/12/2013 8:03
Under 3 Months - Server3 user5 8/14/2014 7:34
Under 3 Months - Server3 user1 7/14/2014 7:30
Under 3 Months - Server3 user3 6/12/2014 8:03
Over 3 Months - Server4 user5 8/14/2013 7:34
Over 3 Months - Server4 user2 6/12/2013 7:30
Over 3 Months - Server4 user3 2/12/2013 8:03
Don't retire TechNet! -
(Don't give up yet - 12,950+ strong and growing)

Similar Messages

  • Can an iPhone be updated with a backup file that is older than the newest available?

    My husband has lost all of his iPhone information when he cleaned it off to start over, then saved a new backup that wiped out all his old info.  Is there any way to go back to a previous backup to retrieve all his lost contact information?

    Yeah, each column in the CSV needs to have a descriptive header. Here's what I used to quickly test that example script I posted above:
    loginDetails.csv:
    Server,User,Date
    Server1,user1,8/12/2014 16:18
    Server1,user2,3/21/2014 12:33
    Server1,Admin,6/13/2013 15:34
    Server2,user3,8/14/2014 7:34
    Server2,Admin,11/14/2013 7:30
    Server2,user4,8/12/2013 8:03
    Server3,user5,8/14/2014 7:34
    Server3,user1,7/14/2014 7:30
    Server3,user3,6/12/2014 8:03
    Server4,user5,8/14/2013 7:34
    Server4,user2,6/12/2013 7:30
    Server4,user3,2/12/2013 8:03
    Output of example from above:
    Under 3 Months - Server1 user1 8/12/2014 16:18
    Over 3 Months - Server1 user2 3/21/2014 12:33
    Over 3 Months - Server1 Admin 6/13/2013 15:34
    Under 3 Months - Server2 user3 8/14/2014 7:34
    Over 3 Months - Server2 Admin 11/14/2013 7:30
    Over 3 Months - Server2 user4 8/12/2013 8:03
    Under 3 Months - Server3 user5 8/14/2014 7:34
    Under 3 Months - Server3 user1 7/14/2014 7:30
    Under 3 Months - Server3 user3 6/12/2014 8:03
    Over 3 Months - Server4 user5 8/14/2013 7:34
    Over 3 Months - Server4 user2 6/12/2013 7:30
    Over 3 Months - Server4 user3 2/12/2013 8:03
    Don't retire TechNet! -
    (Don't give up yet - 12,950+ strong and growing)

  • How can I convert a pdf file that's larger than 100MB to word

    How can I convert a pdf file that's larger than 100MB to word?
    I have just paid $20 to Adobe to get this facility but It won't work ,
    as the pdf is larger than 100MB,
    I actually believe that I have paid twice for adobe but I'll take this up with them,
    in the meantilme,
    do you have any suggestions, I really need this material in word urgently,
    many thanks
    Shanna

    If your files are this large, ExportPDF is the wrong tool for you. You need Adobe Acrobat, which runs locally and does not need to send your files to Adobe.

  • Why can i not see items on ical on my iphone that are older than 6 months ago?

    I am not able to see entries on my iphone ical that are older than 6 months.  am i do something wrong?

    I could be wrong but I dont believe Itunes supports restoring your music from your ipod to a new PC, if you sync from the new pc you will likely lose the music on your ipod. If you search the internet there are third party software programs which will help you retrieve your music from your ipod if it is the only copy you now have. If the music was purchased from itunes you will be able to download it again.
    Hope this helps

  • I just upgraded to 10.9.  My exchange email won't load emails that are older than a few weeks old.  How do I change this setting so I can see all my mail?

    I just upgraded to 10.9.  My exchange email won't load emails that are older than a few weeks old.  How do I change this setting so I can see all my mail?

    Plett81,
    I'm having the exact same problem. It does not seem to be a settings issue but rather some sort of "problem" with mac mail. My Exchange provider was able to setup my mailbox on a test machine running Mavericks and everything pulled in fine, however I cannot duplicate on my upgraded system.
    I was able to get rebuild my mailbox and get the older messages within my Exchange inbox, however none of my folders and old messages outside of the Inbox are downloading/synching.
    **NOTE** I contacted Apple SUpport and they told me to call my email provider. I called my email provider which did as described above and they don't see a problem. SO as suspected it has something to do with the Mavericks update but I'm not sure Apple is willing to help. I might try contacting them one more time and see.

  • How do I read from a text file that is longer than 65536 lines and write the data to an Excel spreadshee​t and have the data write to a new column once the 65536 cells are filled in a column?

    I have data that is in basic generic text file format that needs to be converted into Excel spreadsheet format.  The data is much longer than 65536 lines, and in my code I haven't been able to figure out how to carry over the data into the next column.  Currently the conversion is done manually and generates an Excel file that has a total of 30-40 full columns of data.  Any suggestions would be greatly appreciated.
    Thanks,
    Darrick 
    Solved!
    Go to Solution.

    No need to use nested For loops. No need for any loop anyway. You just have to use a reshape array function. The picture below shows how to proceed.
    However, there may be an issue if your element number is not a multiple of the number of columns : zero value elements will be added at the end of the last column in the generated 2D array. Now the issue depends on the way you intend store the data in the Excel spreadsheet : you could convert the data as strings, replace the last zero values with empty strings, and write the whole 2D array to a file (with the .xls extension ) using the write to spreadsheet function. Only one (minimal) problem : define the number of decimal digits to be used;
    or you could write the numeric array directly to a true Excel spreadsheet, using either the NI report generation tools or ActiveX commands, then replace the last elements with empty strings.
    We need more input from you to decide how to solve these last questions. 
    Message Edité par chilly charly le 01-13-2009 09:29 PM
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        
    Attachments:
    Example_VI.png ‏10 KB

  • Read a CSV file that wont come in sequence

    Hi,
    I have a requirement to load the csv into DB using oracle forms or pl/sql code, but the problem is they are asking to load the csv file which will not come in sequence every time.
    For Example:
    File1:
    col1     col2 col3 col4
    file 2
    col3 col2 col4 col1
    file 3
    col4 col2     col1 col3
    Depending on the header we need to load the file,
    Can we load like this or not?
    If yes, Please help me on this.
    Regards,
    Chaitu.

    SOLUTION 1:
    Contact the person sending such file and tell that its just plain stupid. And ask why on earth would they send such file. Whatever the reason is ask them to fix it.
    SOLUTION 2:
    Here is an approach using External table.
    In the SELECT query i have following assumptions
    1. There are only 5 columns
    2. Each column name has a number part that identifies its position.
    3. The length of all the columns combined together does not exceed 4000 bytes.
    Following is the first file.
    karthick% cat file1.dat
    col1,col2,col3,col4,col5
    1,abc,xyz,200,300
    2,def,sdf,300,20
    Create an external table like this.
    SQL> create table test_et
      2  (
      3     col varchar2(4000)
      4  )
      5  organization external
      6  (
      7     default directory karthickdir
      8     access parameters
      9     (
    10        records delimited by newline
    11        fields terminated by eof
    12     )
    13     location ('file1.dat')
    14  );
    Table created.
    Run the following query.
    SQL> with t
      2  as
      3  (
      4  select rownum rno
      5       , col
      6    from test_et
      7  )
      8  select max(decode(col_no, 1, col)) col_1
      9       , max(decode(col_no, 2, col)) col_2
    10       , max(decode(col_no, 3, col)) col_3
    11       , max(decode(col_no, 4, col)) col_4
    12       , max(decode(col_no, 5, col)) col_5
    13    from (
    14            select t1.rno
    15                 , t1.col
    16                 , regexp_replace(t2.col, '[^[:digit:]]') col_no
    17              from (
    18                      select rno
    19                           , level l
    20                           , regexp_substr(col, '[^,]+', 1, level) col
    21                        from t
    22                       where rno > 1
    23                     connect
    24                          by level <= length(col) - length(replace(col, ',')) + 1
    25                         and prior rno = rno
    26                         and prior dbms_random.value is not null
    27                   ) t1
    28              join (
    29                      select rno
    30                           , level l
    31                           , regexp_substr(col, '[^,]+', 1, level) col
    32                        from t
    33                       where rno = 1
    34                     connect
    35                          by level <= length(col) - length(replace(col, ',')) + 1
    36                         and prior rno = rno
    37                         and prior dbms_random.value is not null
    38                   ) t2
    39                on t1.l = t2.l
    40         )
    41   group
    42      by rno;
    COL_1      COL_2      COL_3      COL_4      COL_5
    1          abc        xyz        200        300
    2          def        sdf        300        20
    Now this is the second file with different column sequence.
    karthick% cat file2.dat
    col2,col3,col1,col5,col4
    mno,gek,1,120,220
    cde,pqr,2,300,350
    Alter the external table and add the second file.
    SQL> alter table test_et location('file2.dat') ;
    Table altered.
    Now run the same query.
    SQL> with t
      2  as
      3  (
      4  select rownum rno
      5       , col
      6    from test_et
      7  )
      8  select max(decode(col_no, 1, col)) col_1
      9       , max(decode(col_no, 2, col)) col_2
    10       , max(decode(col_no, 3, col)) col_3
    11       , max(decode(col_no, 4, col)) col_4
    12       , max(decode(col_no, 5, col)) col_5
    13    from (
    14            select t1.rno
    15                 , t1.col
    16                 , regexp_replace(t2.col, '[^[:digit:]]') col_no
    17              from (
    18                      select rno
    19                           , level l
    20                           , regexp_substr(col, '[^,]+', 1, level) col
    21                        from t
    22                       where rno > 1
    23                     connect
    24                          by level <= length(col) - length(replace(col, ',')) + 1
    25                         and prior rno = rno
    26                         and prior dbms_random.value is not null
    27                   ) t1
    28              join (
    29                      select rno
    30                           , level l
    31                           , regexp_substr(col, '[^,]+', 1, level) col
    32                        from t
    33                       where rno = 1
    34                     connect
    35                          by level <= length(col) - length(replace(col, ',')) + 1
    36                         and prior rno = rno
    37                         and prior dbms_random.value is not null
    38                   ) t2
    39                on t1.l = t2.l
    40         )
    41   group
    42      by rno;
    COL_1      COL_2      COL_3      COL_4      COL_5
    1          mno        gek        220        120
    2          cde        pqr        350        300
    SQL>

  • How do I insert a CSV file that has blank fields? (Some  fields need to be blank) CS4

    Hi, this is the first time I have done a data merge in InDesign. I am trying to insert an address list that often has blank fields in it. The fields are blank since some fields are not relevent to some people (i.e. some of the people don't have cell phones others don't have email addresses) Therefore these people would obviously leave those field blank. The trouble is when I go to do a data merge I am told that the CSV file won't import because some fields are blank. I don't know why InDesign is telling me this, or course some fields are blank they are not relevent to that person. Can someone please tell me how I can get around this problem?

    I tried doing another data merge and I can't seem to get the "remove blank lines" feature to work anymore.
    Here is an image that has all the fields entered in:
    Yet if a field is left blank in the InDesign doc I will get this:
    Or if the blank field comes before another field on the same line I will get this:
    This seems odd to me since I thought these problems were supposed to go away when I clicked this:
    Do you know what might be going wrong? Here is what my data merge place holders look like if it is any help:

  • How do Import a csv file that contains strings

    I have a file that contains numbers as US formmated $$$  such as $1,123,123,123  I have a perl script on one of our linux servers that creates the csv file as
    "Total Dollars","$1,123,123,123","some other string","etc"  but when I import the file into numbers
    Unnamed Table
    Average Price'
    $160
    686'
    $222
    482'
    $114
    820'
    $188
    062'
    I cant find a setting anywhere that says to ignore commas inside a string.  This works in most other applications.

    I apologize but you wrote :
    WALTER-MILANO-ITALY wrote:
    You should be now able to import the file using ; as separator or if you prefer you can do again the change  of ; with ,
    It's not a matter of preferences. The OP can't import a file whose values are separated by semi-colons.
    He must replace them by commas.
    With your scheme :
    Original datas
    'Total Dollars','$1,123,123,123','some other string','etc'
    after your step 1
    'Total Dollars';'$1,123,123,123','some other string','etc'
    after your step 2
    'Total Dollars';'$1,123,123,123''some other string''etc'
    and the datas are completly unusable
    A possible scheme would be :
    Original datas
    'Total Dollars','$1,123,123,123','some other string','etc'
    'Totals Dollars','$12,123,123,123’,’blahblah’,’etc'
    after possible step 1 (replace ‘,’ by ",")
    'Total Dollars";"$1,123,123,123";"some other string";"etc'
    'Totals Dollars";"$12,123,123,123";"blahblah";"etc'
    after possible step 2 (replace single ‘ by ")
    "Total Dollars";"$1,123,123,123";"some other string";"etc"
    "Totals Dollars";"$12,123,123,123";"blahblah";"etc"
    after possible step 3 (replace ";" by ",")
    "Total Dollars","$1,123,123,123","some other string","etc"
    "Totals Dollars","$12,123,123,123","blahblah","etc"
    This one may be imported by Numbers on thez OP’s machine.
    I don't know if these changes may be done with Perl but I know that they are easy to do with AppleScript.
    But honestly, if Perl is able to build a TAB separated values file, it would be more efficient.
    Yvan KOENIG (VALLAURIS, France) mercredi 25 janvier 2012
    iMac 21”5, i7, 2.8 GHz, 12 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2
    My Box account  is : http://www.box.com/s/00qnssoyeq2xvc22ra4k

  • Crystal Reports for Eclipse - Using .csv files?

    I recently installed crystal reports for Eclipse and much of the basic CR functionality seems to be there, but then I added a .csv file as an ODA flat file data source and I can see it in my "Data Source Explorer", but can not seem to drag it into my report to actually use the data.  Am I missing some basic step?
    Thanks,
    Chris

    Hello Chris,
    I recommend to post this query to the [Crystal Reports Design|SAP Crystal Reports; forum.
    This forum is dedicated to topics related to the creation and design of Crystal Report documents. This includes topics such as database connectivity, parameters and parameter prompting, report formulas, record selection formulas, charting, sorting, grouping, totaling, printing, and exporting but also installation and registering.
    It is monitored by qualified technicians and you will get a faster response there.
    Also, all Crystal Reports Design queries remain in one place and thus can be easily searched in one place.
    Best regards,
    Falk

  • Can any version of Excel save to a CSV file that is either UTF-8 or UTF-16 encoded (unicode)?

    Are there any versions of Excel (chinese, japanese, russian... 2003, 2007, 2010...) that can save CSV files in Unicode (either UTF-8 or UTF-16)?
    If not, is the only solution to go with tab-delimited files (save as Unicode-text option)?

    Hi Mark,
    I have the same problem. Trying to save my CSV file in UTF8 encoding. After several hours in searching and trying this also in my VSTO Add-In I got nothing. Saving file as Unicode option in Excel creates file as TAB separated. Because I'd like to save the
    file in my Add-In application, the best to do is (for my problem) saving file as unicode tab delimited and then replacing all tabs with commas in the file automatically.
    I don't think there is a direct way to save CSV as unicode in Excel. And I don't understand why.

  • Need to Match Result in Report to Data Provider

    Hi!
    My report is using an Excel file to populate my "Payout" data provider.  The data provider has the following values
    Performance/Payment/Level
    10 pt  /5%  /1
    15 pt  /7%  /2
    My report is calculating a performance of 12 pt which I am trying to match against the "Payout" data provider to get the Payment of 5%.  Is this possible in DeskI and if so how?
    Any help you can provide will be appreciated.
    Thanks!
    Edited by: akrupa on Sep 25, 2009 8:45 PM
    Edited by: akrupa on Sep 25, 2009 8:47 PM
    Edited by: akrupa on Sep 25, 2009 8:49 PM

    Hi,
    If the number of payment levels is not to big you might concider to put them on one line in the excel file.
    Like:
    level 1 points | level 1 percentage | level 2 points | level 2 percentage
    10 | 5 | 15 | 7
    When you read that into BusinessObjects you can then assign the percentages by using the formula:
    =If <performance> < <level 1 points> Then 0 Else If <performance> < <level 2 points> Then <level 1 percentage> 
    Else <level 2 percentage>
    Regards,
    Harry

  • Can we use Report Designer report as Data Provider in WAD

    Hi all,
    i have a requirement to desing WAD report, in that i need to include report designer report in one column and another 2 graphs.
    I am not understanding how to include report designer report in WAD as DATA PROVIDER. Can we do this or not?
    Thanks in advance,
    Venky

    Hi
    You can include Report from report designer using Report designer webitem in BI 7.0. But you can't create report designer report in WAD as DATA PROVIDER.
    Check below link
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/0f/227b42a4449041e10000000a1550b0/frameset.htm
    Regards,
    Ravi Kiran

  • How to read a tiff file that has more than one page?

    Hi,
    I use JAI to read TIFF image and get the pixels from a raster object. A TIFF file can have more than one image in itself. The JAI doc from SUN only mentioned that we can get the number of IFD (image file directory) by using
    getNumDirectories() function but no description about how to get different images separately out of one TIFF file. Does any one know how to do it or some example programs implementing such function? Thanks a lot.
    Marvin

    I'm not sure if this helps, but here's a web page which talks about Image I/O:
    http://java.sun.com/products/java-media/jai/iio.html
    For your problem, they have a sample solution which can read a specific page of a multi-page tiff file, so perhaps you could make a loop to read all of the pages:
    http://java.sun.com/products/java-media/jai/forDevelopers/samples/MultiPageRead.java
    Good luck!

  • Report Designer : Data Provider & Report Section .

    Hi Experts ,
    Is it a mandatory compulsion to insert data provider to create a formatted report in Report designer . can we not create it through report section.
    thanks & regards ,
    M.S

    when you insert a data provider, it automatically creates a Report section. If you start with report section, then you still need to add data provider to it.

Maybe you are looking for

  • Satellite Pro A200 (PSAE7): unable to update firmware under Vista

    Hi, I tried tp upgrade the firmware of my HD-DVD drive (SD L802B) with the new TO35 firmware, but it is not possible. The upgrade button of that Winvup is not selectable. I had the same problem with an older firmware, but i just thought this was beca

  • How to transfer files from my pc with Windows 7 to my Iphone 5s

    I want to transfer files/ videos /photos  from My PC with windows 7 to my Iphone 5S. Which sowftware or application shall i download for the same. kindly help

  • Problem w/ thread in Database forum?

    Is there a problem with this thread? Datablock writes Most threads that are answered will say "This thread is answered." and below one of the post will be marked "Correct". In this thread, it says "This question is answered. Helpful answers available

  • Netflix on Amazon App Store

    Recently upgraded to the passport. Cannot find Netflix app on the amazon app store. On my q5 it wouldn't show up if you search for 'netflix' but I located the app in the Top Free list. Moving to the passport I am unable to locate the app. Also tried

  • Ipad wont stay on

    ipad slipped off passenger seat in car, now it won't stay on.  What do i do?