Updating information in .CSV file - ongoing report

i have a script im running that gives me a report of machines currently available on the network and exports that information to a .csv file 
What im trying to accomplish is AFTER the initial run of the script if the script runs again and the machine is available i would like that cell to update with AVAILABLE as opposed to writing a whole new line item.
I hope thats a clear explanation. I'm assuming if i use the -append flag it will create new line items which im trying to stay away from as i'm sure this will come in handy when running some dynamic html reporting pages
here is my current script
Function get-mdtbuiltcomputers {
    param (
        [string[]]$computername='localhost'
    foreach($comp in $computername){
        $p=[ordered]@{
            Computername=$comp
            Status='Unavailable or not a Standard MDT Image'
            MDTImageDate=$null
        $path=Test-Path "\\$comp\c$\Windows\smsts.ini"
        $connected = Test-Connection -quiet -count 2 -delay 2 -ComputerName $comp
        if($path -and $connected){
            $file=Get-ChildItem \\$comp\c$\Windows\smsts.ini
            $p.Status='Available'
            $p.MDTImageDate=$file.CreationTime
         New-Object PsObject -Property $p
when i run it from my console i use:
get-mdtbuiltcomputers -computername xxxxxxx | export-csv c:\mdt.csv -notypeinformation
Rich Thompson

Hint:
if($p=$csv|?{$_.ComputerName -eq $comp}){
$reuse=$true
}else{
$p=[ordered]@{
Computername=$comp
Status='Unavailable or not a Standard MDT Image'
MDTImageDate=$null
if(-not $reuse){
# append to existing CSV
}else{
# do nothing
¯\_(ツ)_/¯

Similar Messages

  • Issue Exporting TCP IP stack information to CSV file

    I'm having difficulties reporting IP information (IPAddress, Default Gateway,
    and DNSSearchOrder) in TCP IP stack and exporting it to CSV file.  But if I remove the export-CSV statement everything appears fiine on the screen.  for privacy reasons I've removed columns after DNS Search Order.  note my examples below:
    Get-WMIObject -Class Win32_NetworkAdapterConfiguration -ComputerName (Get-Content .\Servers.txt) -Credential DOMAIN\USERADDCOUNT |
    Where-Object -FilterScript {$_.IPEnabled} |
        Select-Object DNSHostName, IPAddress,  DefaultIPGateway, DNSServerSearchOrder, WINSPrimaryServer, WINSSecondaryServer,
    @ {Label="ADSDomainName";Expression={(Get-WMIObject -Class Win32_ComputerSystem -ComputerName $_.__Server).Domain}} |
         Export-csv PowerShell-ServerProfileIPInformation.csv -NoTypeInformation
    DNSHostName    IPAddress         DefaultIPGateway DNSServerSearchOrder
    SERVER1100496 System.String[] System.String[]    System.String[]
    SERVER1100497 System.String[] System.String[]    System.String[]
    SERVER1100169 System.String[] System.String[]    System.String[]
    SERVER1100496 System.String[] System.String[]    System.String[]
    SERVER1100497 System.String[] System.String[]    System.String[]
    SERVER1100169 System.String[] System.String[]    System.String[]
    SERVER1100496 System.String[] System.String[]    System.String[]
    SERVER1100497 System.String[] System.String[]    System.String[]
    SERVER1100169 System.String[] System.String[]    System.String[]

    Hi,
    This is happening because you are trying to export a array. Simple way to get rid of this is, convert the array into comma separated values and then export it.I slightly modified your code as below.
    $IPs = Get-WMIObject -Class Win32_NetworkAdapterConfiguration -ComputerName (Get-Content .\Servers.txt) -Credential DOMAIN\USERADDCOUNT | ? {$_.IPEnabled }
    $Outarray = @()
    foreach($IP in $IPs) {
    $OutputObj = New-Object -TypeName PSobject
    $OutputObj | Add-Member -MemberType NoteProperty -Name ComputerName -Value $IP.DNSHostName
    $OutputObj | Add-Member -MemberType NoteProperty -Name IPAddress -Value $IP.IPAddress -join ","
    $OutputObj | Add-Member -MemberType NoteProperty -Name DefaultIPGateway -Value $IP.DefaultIPGateway -join ","
    $Outarray += $OutputObj
    $OutArray | export-csv c:\temp\IPdetails.csv -NoTypeInformation
    If you want to understand more on how to export such kind of data to csv/excel, refer to this(http://learn-powershell.net/2014/01/24/avoiding-system-object-or-similar-output-when-using-export-csv/) article written by Boe Prox. It is really worth reading.
    If you are looking for complete script that can export Ip config details of remote computers into CSV, try the script mentioned at
    http://techibee.com/powershell/powershell-get-ip-address-subnet-gateway-dns-serves-and-mac-address-details-of-remote-computer/1367
    Hope this helps.
    Thanks,
    Sitaram Pamarthi
    Blog : http://techibee.com
    Follow on Twitter
    This posting is provided AS IS with no warranties or gurentees,and confers no rights

  • Updating Database From csv File in Web Dynpro Java

    Hi Gurus,
    I'd like to write an WDJ where the (super-)user can upload a csv file and delta-update the content of this file witch an external database.
    Could you please give some me hints & examples.
    Thanks in advance,
    Farid
    ps. answers will be rewarded with points, of cource.

    Hi Farid:
    From your question it seems like you want to write a WDJ application which writes a CSV file after connecting to a database and everytime you do so, updates the file with the new record from the DB.
    For this, I wouldnt think to write an application in WebDynpro since its an over kill, unless you want to host this appln in a portal environment and want it accessible for  a set of people.
    Ideally you could use the JDK api to open a connection to the database and then then file api to write to files. You would need to use an identifier somewhere to know the last record read and written to the file.
    Incase you put in the type of db you want to connect to, i could be of more help
    Thanks,
    LioneL

  • Update on importing csv file for drop down options

    My search on this topic provided me with a suggestion for the capability to upload a csv file for drop down options.  However, the discussion was from April 2011.  Has any progress been made on this since?
    Thanks.

    This is not something we currently support but you can add or vote on feature ideas:
    http://forums.adobe.com/community/formscentral?view=idea
    If you need to add a new idea click "Create an idea" under "Actions" in the top right.
    Thanks,
    Jeff

  • OBIEE 11g - issue when export to a csv file

    Hello,
    I have an issue when I try to export to a csv file a report having numeric feild, when I export and open the file in notepad the trailing zeros to the right of decimal points do not show up. When export to another formats (such as excel, pdf) the trailing zeros appears correctly. e..g, 100.00 appears as 100, 100.50 appears as 100.5.
    Do you know what can be done in order to have trailing zeros to the right of decimal points to appear in a csv?
    Thanks

    This is a bug see below.
    Bug 13083479 : EXPORT DATA TO CSV FORMAT DOES NOT DOWNLOAD EXPANDED HIERARCHICAL COLUMNS
    Proposed workaround : OBIEE 11.1.1.5: Pivot Table Report Export To Csv Does Not Include Hierarchical Data [ID 1382184.1]
    Mark if answered.!
    Thanks,
    SVS

  • Importing users into WGM from csv file issues/crash

    Hi,
    i've been importing user information from csv files into WGM via the +server >  import+ function .
    It worked the first few times but now when i try the import progress bar pops up and promptly disappears without any thing importing.
    i've tried restarts, new admin account, reinstalled  WGM.
    I've also trashed some pref but i don't really know which ones i should be losing.
    The servers an OD master.
    any help would be appreciated.
    as a last resort what do i need to backup/save if i were to format/reinstall osx server? keeping my settings etc.....
    thanks
    paul

    What I did was:
    Exported the user list, to create an XML file in the correct format.
    Using this format, I created a spreadsheet in Excel (sorry Apple), and in the final column I created a field that concatenated the information I wanted in the ':' deliminated format of the previously export XML.
    Then just copy and past via pico into a pure text file and imported that.
    You have to be careful with comments in Passenger, using special characters (';!@#$%^ and others can cause the WGM to fail and crash.

  • CSV FILES DOESN'T LOAD WITH RIGHT DATA USING SQL LOADER

    Hi pals, I have the following information in csv file:
    MEXICO,Seretide_Q110,2010_SEE_01,Sales Line,OBJECTIVE,MEXICO,Q110,11/01/2010,02/04/2010,Activo,,,MEXICO
    MEXICO,Seretide_Q210,2010_SEE_02,Sales Line,OBJECTIVE,MEXICO,Q210,05/04/2010,25/06/2010,Activo,,,MEXICO
    When I use SQLLOADER the data is loaded as follow:*
    EXICO,Seretide_Q110,2010_SEE_01,Sales Line,OBJECTIVE,MEXICO,Q110,11/01/2010,02/04/2010,Activo,,,MEXICO
    And for the next data in a csv file too:
    MX_001,MEXICO,ASMA,20105912,Not Verified,General,,RH469364,RH469364,Change Request,,,,,,,Y,MEXICO,RH469364
    MX_002,MEXICO,ASMA,30094612,Verified,General,,LCS1405,LCS1405,Change Request,,,,,,,Y,MEXICO,LCS1405
    the data is loaded as follow:
    X_001,MEXICO,ASMA,20105912,Not Verified,General,,RH469364,RH469364,Change Request,,,,,,,Y,MEXICO,RH469364
    X_002,MEXICO,ASMA,30094612,Verified,General,,LCS1405,LCS1405,Change Request,,,,,,,Y,MEXICO,LCS1405
    I mean the first character is truncated and this bug happens with all my data. Any suggestion? I really hope you can help me.
    Edited by: user11260938 on 11/06/2009 02:17 PM
    Edited by: Mariots on 12/06/2009 09:37 AM
    Edited by: Mariots on 12/06/2009 09:37 AM

    Your table and view don't make sense so I created a "dummy" table to match your .ctl file.
    SQL> create table CCI_SRC_MX
      2  (ORG_BU               varchar2(30)
      3  ,name                 varchar2(30)
      4  ,src_num              varchar2(30)
      5  ,src_cd               varchar2(30)
      6  ,sub_type             varchar2(30)
      7  ,period_bu            varchar2(30)
      8  ,period_name          varchar2(30)
      9  ,prog_start_dt        date
    10  ,prog_end_dt          date
    11  ,status_cd            varchar2(30)
    12  ,X_ACTUALS_CALC_DATE  date
    13  ,X_ACTUAL_UPDATE_SRC  varchar2(30)
    14  ,prod_bu              varchar2(30)
    15  ,ROW_ID               NUMBER(15,0)
    16  ,IF_ROW_STAT          VARCHAR2(90)
    17  ,JOB_ID               NUMBER(15,0)
    18  );
    Table created.
    SQL> create sequence GSK_GENERAL_SEQ;
    Sequence created.I simplified your .ctl file and moved all the constant and sequence stuff to the end. I also changed the format masks to match the dates in your data.
    LOAD DATA
    INFILE 'SBSLSLT.txt'
    BADFILE 'SBSLSLT.bad'
    DISCARDFILE 'SBSLSLT.dis'
    APPEND
    INTO TABLE CCI_SRC_MX
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    (ORG_BU
    ,NAME
    ,SRC_NUM
    ,SRC_CD
    ,SUB_TYPE
    ,PERIOD_BU
    ,PERIOD_NAME
    ,PROG_START_DT          DATE 'dd/mm/yyyy'
    ,PROG_END_DT            DATE 'dd/mm/yyyy'
    ,STATUS_CD
    ,X_ACTUALS_CALC_DATE    DATE 'dd/mm/yyyy'
    ,X_ACTUAL_UPDATE_SRC
    ,PROD_BU
    ,row_id                 "GSK_GENERAL_SEQ.nextval"
    ,if_row_stat            CONSTANT 'UPLOADED'
    ,job_id                 constant 36889106
    {code}
    When I run SQL Loader, I get this:
    {code}
    SQL> select * from CCI_SRC_MX;
    ORG_BU  NAME           SRC_NUM      SRC_CD      SUB_TYPE   PERIOD_BU  PERIOD_NAME  PROG_START_DT        PROG_END_DT          STATUS_CD  PROD_BU  ROW_ID IF_ROW_STAT    JOB_ID
    MEXICO  Seretide_Q110  2010_SEE_01  Sales Line  OBJECTIVE  MEXICO     Q110         11-JAN-2010 00:00:00 02-APR-2010 00:00:00 Activo     MEXICO        1 UPLOADED     36889106
    MEXICO  Seretide_Q210  2010_SEE_02  Sales Line  OBJECTIVE  MEXICO     Q210         05-APR-2010 00:00:00 25-JUN-2010 00:00:00 Activo     MEXICO        2 UPLOADED     36889106
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Problem in handling complex CSV file

    Hi,
    I am facing a strange problem in handling a complex CSV file.
    The content of the file is as follows. It is getting executed through an XSD and the target is a table.
    First time when the interface is executed ( for e.g session id - 19001) it is getting completed successfully.
    Now when making changes in the CSV file suppose adding ( for e.g.-
    DEPT,D05,Books,ABC Store
    CUST,C01,Sayantan,[email protected]
    CUST,C02,Shubham,[email protected])
    or deleting ( for e.g.-
    CUST,C02,Sarbajit,[email protected])
    and running the interface I am not getting the added D05 in the target table nor my C02 data is getting removed i.e.- the updated data in CSV file is not getting fetched and I am getting the same records as i got when i ran interface of session id 19001.
    I am not getting why it is happening??
    The CSV file used in session id -19001 is:
    DEPT,D01,Retail,World Mart
    CUST,C01,Anindya,[email protected]
    CUST,C02,Rashni,[email protected]
    DEPT,D02,Food,Food Bazar
    CUST,C01,Abhijit,[email protected]
    CUST,C02,Anirban,[email protected]
    CUST,C03,Sharmistha,[email protected]
    DEPT,D03,Water,SW
    CUST,C01,Nirmalya,[email protected]
    DEPT,D04,Clothes,City style
    CUST,C02,Sarbajit,[email protected]
    CUST,C03,Abhishek,[email protected]

    Here's what you can do to handle CSV files using HSQL.
    Say the CSV file contains order data. Each order record contains data about a particular order like order number, product code, quantity, ordered by, date etc. Now lets take a hypothetical requirement which says, the user needs to know how many orders were ordered per product.
    Option 1]  At the basic level, read the order file, parse each line and write the logic to get count of orders per product.
    Option 2] Load this CSV file into a database like MySQL and write database queries to get the orders per product.
    So where does this leave us? Have we run out of options? I am sure we would have tried & used the above two options . But I wanted a different approach. Following questions were lingering in my mind:
    1] Why can’t I write SQL queries against the CSV file itself. After all it’s like any RDBMS table.
    2] Why should I load the CSV file into some database before I query it?
    3] Why can’t I create a database table & attach the CSV file to it?
    Continue Reading Here: Handling CSV Files

  • Comparsion of .csv file and sqlserver table

    Hi Friends,
    I have master table  (item master) having more then 60000 records I fetched into offline dataset and loading each time in vb.net form instead of get from database which is costly, I want to inquire is there any function/technique  available that
    when ever my table in a database will be updated automatically my offline .csv (store in client local harddisk)  will be updated.
    thank you.
    Regards,
    asad

    You can create a sql server agent job for that.
    Schedule the job based on your convenience and first step of the job would be to check control table that you maintain (with a bit field in it) if the bit is set. If bit is set proceed to next step to call a script which will do updation of offline csv file.
    You can use OPENROWSET or SSIS pkg for that. Finally it will reset bit once updation is done. 
    The bit will set during the updation of your table by means of  trigger code.
    You can keep period of job as hourly
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How can I download report information present in Analytics tab of Oracle Cloud Service RightNow CX  to a csv file? I need to automate this for daily run

    Hi,
    I am working on a project where I need to download certain report data from RightNow Oracle Cloud Service to a csv file and process it into the warehouse. I have seen certain articles in Oracle stating about Dotnet API and PHP API but not sure if it can use them. Also I am not very confident with either Dotnet or PHP.
    Is there any other approach that I can use to download the data, can it be done through curl?
    Please suggest.
    Thanks
    Sarthak

    Hi,
    This community is for discussion on Oracle Business Intelligence Cloud Service. This service is currently not associated with Oracle RightNow Cloud Service.
    Thanks,
    Pravin

  • How to update csv file dynamically  from Catalog manager

    HI - In OBIEE we used to generate report statistics into csv files from Catalog manager.But this task should be automatic or dynamic process.So it means that each and every when catalog get changes that information will be captured into CSV file by dynamic way. To achieve this process we should have one script or batch etc.............
    Your help is highly appreciated.

    Yes we can achieve this by enabling Usage Tracking.
    Create a report with all the columns you need and schedule the report using Agents with some time frame say like EOD everyday.There we can see what all the changes as done to the catalog.
    Do let me know if you need any help to achieve this.
    Mark if helps,
    Thanks,

  • Unable to save the webi report results in CSV file in XIR2 environment

    Hi Team,    
    We have one WebI report in BOXIR2 version and it fetching nearly 76+ records in the report. The report is running fine without any issues and when i am trying to export the results into CSV file we are getting the error msg (Maximum Binary file size exceeded WIS30271). The file size is more than 80MB and hence it throwing this error. I have checked the Maximun Binary File size that is set in CMC and it is set to 80MB.
    When i ran the same query in the database and exporting the results in to csv file the file size is under 80MB. I would like to know the reason why there is a difference in the file size when running the query manually in database and exporting in to csv file and to export the results set in to csv through business objects.

    Below are the possible causes to get this error message:
    1] When a large Web Intelligence report is exported to CSV format, we get error: Max Binary file size limit exceeded. The document is too large to be processed by the server. Error WIS 30271
    Cause
    This error message appears because BusinessObjects Enterprise allows documents to be saved with the limit specified for Web Intelligence Report server settings in the Central Management Console(CMC).
    To resolve the error follow the below steps:
    - Login to Central Management Console (CMC) using BusinessObjects Enterprise "Administrator".
    - Navigate to "Home >> Servers".
    - Click on "Web Intelligence Report Server" to open its properties.
    - Increase the "Maximum Binary File Size"(Default value=50 MBytes; Maximum value = 65535 MBytes).
    - Click on "Apply" and then on "Update".
    - Allow the Web Intelligence server to restart.
    2] In Web Intelligence, when attempting to save a report to Excel or Portable Document Format  (PDF), the following error message appears:
    "Max binary file size limit exceeded. The document is too large to be processed by the server. Contact your database administrator. (Error: WIS 30271)".
    Cause:
    This error message appears because Business Objects Enterprise allows documents to be saved up to the limit set for Web Intelligence Report Server in the Central Management Console (CMC).  The default file size limit is 50 megabytes for binary file types like PDF and Excel.
    To resolve this error message, you will need to increase the Max Binary file size value.
    1.      Open the CMC.
    2.      Browse to Servers
    3.      Click on your Web Intelligence Report Server.
    4.      On the Properties page, increase the Maximum Binary File Size.
    5.      Apply the setting and allow the Web Intelligence Report Server to restart.
    Increasing these values too high could impact Web Intelligence performance when users attempt to save excessively large files.
    Hope this helps.

  • How can i update an existing item in sap using CSV file?

    Hi,
    i am trying to update an existing Item in SAP using a CSV file.
    in the message log i get an error message that the item already exists.
    what should i do in order to update the existing record?
    Thanks, Udi

    Hi..........
    I would sugest you to use Tab delimited file and choose proper option in order to update the itsm master in DTW......
    Regards,
    Rahul

  • Error while refreshing a report using local csv file

    Hi,
    I'm using BI 4.1 SP02.
    While using Rich client, I've created a report with some merged queries, while one of the queries is a local CSV file - saved on AD in some server, and not on the repository inside BO.
    While trying to refresh the report with the Rich client, it all went great.
    Now, while using BI Launchpad java based app, I can't refresh the report - I get the following error:
    "An Internal error occurred while calling 'processDPCommandsEx' API. (Error: ERR_WIS_30270) (WIS 30270)"
    Should I be able to refresh a report without the Rich if it contains a local file (which is possible to EDIT only with rich) ?
    If so, then did someone ran into this error?
    Thank you,
    Or.

    First of all, thanks for both of the replies.
    Second,
    my problem is unlikely have to do something with permissions from one reasons -
    when the report is using XLS\XLSX on same folder(with same name prefix) - the report is running without any problem.
    Only problem is while refreshing without Rich while the source is network CSV file.
    Any suggestions?
    Thanks.

  • Download CSV-File from Interactive Report

    Dear all,
    I want to download a CSV-File from a Interactive report.
    The content of the Rows in Excel:
    Erste,"B","C","D","E","F","G","H","I","J","K","L","M","N","O","P"
    IBC ->,"-","1","2","3","4","5","6","7","8","9","10","11","12","13","14" [...]
    How can I solve this problem?
    Thanks for help.

    Your CSV-File use "comma" as separator. But Excel think, that CSV-File separator is "semicolon".
    Try to set "CSV Separator"=";" in section "Report Attributes" - "Download".

Maybe you are looking for

  • Mac OSx 10.6.8 with C7280 scanning problem

    I have a HP Photosmart C7280 that works as a printer on my Mac computer but will not work when I try to scan. It used to scan to the computer, but I upgraded to OS X 10.6.8 and now it won't. I can't do any more upgrades because my computer hardware w

  • Time Zone support

    I understand the basic gist of time zone support as it is pretty straight forward, but I'm constantly finding myself confused when I use time zone support when I travel.  For instance, I use EDT and sometimes put events in my calendar that I know I'l

  • How do I turn off the automated Adobe Cloud ID window that opens everytime I turn on my computers.  Do NOT subscribe to CC. HELP.

    How do I turn off the automated Adobe Cloud ID window that opens every time I turn on my computers.  I want this annoying window to stop appearing.  I do not and will not subscribe to "Adobe Cloud" but the program (all 197 MB) somehow found it's way

  • Confusion abt event count

    hi all i have a confusion abt the event count value for the signatures. say if i set the event count value to 5 then the signature will fire only if the event ocours 5 times right. does it mean that when the first time the attack packet comes the sig

  • Slow listing of network shares

    Hi all, after clicking on a computer on a computer (mac or windows), the list with shares takes about 8 seconds to appear. on another macbook the shares are shown directly after the click. any solutions? greetings soCram