How to export data to multiple csv files?

Hey Scripting Guys,
As stated by the name I'm a novice at scripting.  Typically I'm able to resolve most of my scripting challenges by reading through your site or scouring the internet.  This challenge I haven't been able to resolve.  Please help!!
I'm running a script (posted below) to grab data and export it to a csv file.  My challenge is that I want to run the script daily via task manager and have it create a new csv file either daily or weekly.  I'm having trouble with the scripting
creating a new csv file.  How do I resolve this?  
It would be beneficial to append the date to a standard file name, ex. c:\exportedcsv7-11-2014.csv; the next day it would be c:\exportedcsv7-12-2014.csv; and so on.
Thank you in advance to any assistance.
Respectfully,
ScriptingNovice
Get-Datastore -Name "*DS*" | Sort $_.name | Get-View | Select -ExpandProperty Summary | `
Select Name,
@{N=”FreeSpaceGB”;E={[Math]::Round($_.FreeSpace/1GB,2)}},
@{N=”CapacityGB”; E={[Math]::Round($_.Capacity/1GB,2)}},
@{N=”UncommittedGB”; E={[Math]::Round($_.Uncommitted/1GB,2)}},
@{N=”ProvisionedGB”;E={[Math]::Round(($_.Capacity – $_.FreeSpace + $_.Uncommitted)/1GB,2)}},
@{N=”Over-Provisioned-DS”;E={([Math]::Round($_.Capacity/1GB,2)) – ([Math]::Round(($_.Capacity – $_.FreeSpace + $_.Uncommitted)/1GB,2))}}| `
select Name,CapacityGB,FreespaceGB,ProvisionedGB,UncommittedGB,Over-Provisioned-DS | export-csv -notype c:\vmds.csv

Thank you for the information and the tip.  I took your advice and did some research on Strings, something that I do have trouble grasping.  I'm familiar with variables already and feel comfortable using them.  I also need to study .Net which
I totally don't understand. 
Since I appreciate your advice and guidance I'd like to know if I'm on the correct track.  Please look at my breakdown to see if I'm explaining it correctly.
$d=Get-Date
Here a variable is being created using the Get-Date cmdlet, if we execute $d the date will appear
$d.ToString('dd-MM-yyyy')
This converts the date into the format dd-MM-yyyy.
I took the information and tips you provided then came up with this after reading about strings.
export-csv -notype "c:\folder\vmds_$($d.ToString('MM-dd-yyyy')).csv"
The double quotes evaluate the variables.  The single quotes do not evaluate anything they just show what's inside of them (a.k.a. literal string). The $() evaluate the expression in ('MM-dd-yyyy') before writing it.
You are correct I definitely need to strengthen the foundation of my basics.  Thank you for the direction and advice.

Similar Messages

  • Which version of the Forms Central subscription will allow me to export data to excel (CSV file)?

    Which version of the Forms Central subscription will allow me to export data to excel (CSV file)?

    Hi Heather 349
    I believe you can do it with both FormsCentral Basic and FormsCentral PLUS
    Also Refer : Tutorial: Exporting Responses to Excel, CSV or PDF

  • How to SAP data convert into csv file.

    hi,
    i have a one internal table , and i want to extract SAP data into csv file with filed separator ','(comma).
    Thanks

    you can use this coding for slove yours issue
    tables: vbak.
    Use type pool:
    TYPE-POOLS: TRUXS.
    parameters: p_erdat like vbak-erdat.
    DATA: COM TYPE C . For comma SEPERATOR
    data: begin of itab occurs 0,
          vbeln like vbak-vbeln,
          erdat like vbak-erdat,
          end of itab.
    DATA: ITAB1 TYPE TRUXS_T_TEXT_DATA OCCURS 0 .
    COM = ','.
    select vbeln
           erdat
           into table itab
           from vbak
           where erdat = p_erdat.
    FM:
    CALL FUNCTION 'SAP_CONVERT_TO_CSV_FORMAT'
    EXPORTING
       I_FIELD_SEPERATOR          = COM
      I_LINE_HEADER              =
      I_FILENAME                 =
      I_APPL_KEEP                = ' '
      TABLES
        I_TAB_SAP_DATA             =  ITAB
    CHANGING
       I_TAB_CONVERTED_DATA       = ITAB1
    EXCEPTIONS
      CONVERSION_FAILED          = 1
      OTHERS                     = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    FM:
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
      BIN_FILESIZE                  =
        FILENAME                      = 'C:\TEST.CSV'
       FILETYPE                       = 'ASC'

  • Exporting data to a csv file and include column names

    I am creating a SSIS package which creates a .csv file.  The package works fine except it is not putting the column names as the first row.
    How do I get the column names to also export?
    Thanks,
    ~John

    SQL Server 2012 T-SQL has the new FORMAT command:
    SELECT FORMAT(CONVERT(MONEY,123456.78),'c0','en-US'), -- $123,457
    FORMAT(CONVERT(MONEY,123456.78),'c2','en-US'), -- $123,456.78
    FORMAT(CONVERT(MONEY,123456.78),'c2','en-GB'), -- £123,456.78
    FORMAT(CONVERT(MONEY,123456.78),'c2','de-DE') -- 123.456,78 €
    Prior to SS 2012:
    SELECT CONVERT(varchar(40),CONVERT(MONEY,123456.78),1) -- 123,456.78
    SSIS Import/Export Wizard:
    http://www.sqlusa.com/bestpractices/ssis-wizard/
    Kalman Toth SQL 2008 GRAND SLAM
    New Book: SQL Programming & Database Design Using Microsoft SQL Server 2012

  • How to extract data from multiple flat files to load into corresponding tables in SQL Server 2008 R2 ?

    Hi,
              I have to implement the following scenario in SSIS but don't know how to do since I never worked with SSIS before. Please help me.
              I have 20 different text files in a single folder and 20 different tables corresponding to each text file in SQL Server 2008 R2 Database. I need to extract the data from each text file and
    load the data into corresponding table in Sql Server Database. Please guide me in how many ways I can do this and which is the best way to implement this job.  Actually I have to automate this job. Few files are in same format(with same column names
    and datatypes) where others are not.
    1. Do I need to create 20 different projects ?
                   or
        Can I implement this in only one project by having 20 packages?
                 or
        Can I do this in one project with only one package?
    Thanks in advance.

    As I said I don't know how to use object data type, I just given a shot as below. I know the following code has errors can you please correct it for me.
    Public
    Sub Main()
    ' Add your code here 
    Dim f1
    As FileStream
    Dim s1
    As StreamReader
    Dim date1
    As
    Object
    Dim rline
    As
    String
    Dim Filelist(1)
    As
    String
    Dim FileName
    As
    String
    Dim i
    As
    Integer
    i = 1
    date1 =
    Filelist(0) =
    "XYZ"
    Filelist(1) =
    "123"
    For
    Each FileName
    In Filelist
    f1 = File.OpenRead(FileName)
    s1 = File.OpenText(FileName)
    rline = s1.ReadLine
    While
    Not rline
    Is
    Nothing
    If Left(rline, 4) =
    "DATE"
    Then
    date1 (i)= Mid(rline, 7, 8)
     i = i + 1
    Exit
    While
    End
    If
    rline = s1.ReadLine
    End
    While
    Next
    Dts.Variables(
    "date").Value = date1(1)
    Dts.Variables(
    "date1").Value = date1(2)
    Dts.TaskResult = ScriptResults.Success
    End
    Sub

  • How to display data from local csv files (in a folder on my desktop) in my flex air application using a datagrid?

    Hello, I am very new to flex and don't have a programming background. I am trying to create an air app with flex that looks at a folder on the users desktop where csv files will be dropped by the user. In the air app the user will be able to browse and look for a specific csv file in a list container, once selected the information from that file should be displayed in a datagrid bellow. Finally i will be using Alive PDF to create a pdf from the information in this datagrid laid out in an invoice format. Bellow is the source code for my app as a visual refference, it only has the containers with no working code. I have also attached a sample csv file so you can see what i am working with. Can this be done? How do i do this? Please help.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="794" height="666">
        <mx:Label x="280" y="19" text="1. Select Purchase Order"/>
        <mx:List y="45" width="232" horizontalCenter="0"></mx:List>
        <mx:Label x="158" y="242" text="2. Verify Information"/>
        <mx:DataGrid y="268" height="297" horizontalCenter="0" width="476">
            <mx:columns>
                <mx:DataGridColumn headerText="Column 1" dataField="col1"/>
                <mx:DataGridColumn headerText="Column 2" dataField="col2"/>
                <mx:DataGridColumn headerText="Column 3" dataField="col3"/>
            </mx:columns>
        </mx:DataGrid>
        <mx:Label x="355" y="606" text="3. Generated PDF"/>
        <mx:Button label="Click Here" horizontalCenter="0" verticalCenter="311"/>
    </mx:WindowedApplication>

    Open the file, parse it, populate an ArrayCollection or XMLListCollection, and make the collection the DataGrid dataProvider:
    http://livedocs.adobe.com/flex/3/html/help.html?content=Filesystem_08.html
    http://livedocs.adobe.com/flex/3/html/help.html?content=12_Using_Regular_Expressions_01.ht ml
    http://livedocs.adobe.com/flex/3/html/help.html?content=dpcontrols_6.html
    http://livedocs.adobe.com/flex/3/langref/mx/collections/ArrayCollection.html
    http://livedocs.adobe.com/flex/3/langref/mx/collections/XMLListCollection.html
    If this post answered your question or helped, please mark it as such.

  • How to export data to an excel file using VBScript

    I'm trying to create a VBScript in DIAdem (V9.1) which automatically saves all the current channels in the data portal to an excel file. I've tried using 'Call ExcelExport' and specify a full file path but the file is never created. What am I doing wrong?
    Thanks,
    Steve

    Hi Steve,
    There are a couple of other things you can try. If you don't like Ingo's suggestion about multiple Excel STP files, your only real option is to create an ASCII file. Note that you can give the ASCII file an extension of *.CSV or even *.XLS, and Excel will read it right in.
    So the question boils down to how to format the ASCII export correctly and quickly.
    You can use the DAT file approach Ingo mentioned and even re-write the file with VBS to include a few header lines of your own choosing. Note that this approach does NOT support text channels. There is an example of this in the zip file attached below.
    You can alternatively use the CSV export function in DIAdem 9.1 to output an ASCII file with the name of each channel as the single header row above all the values. There is an example of this in the zip file attached below.
    You can also just read the values from the DIAdem channels and write them out to an ASCII file cell by cell, managing everything with VBScript calls. There is an example of this in the zip file attached below.
    I hope that helps,
    Brad Turpin
    DIAdem Product Support Engineer
    National Indstruments
    Attachments:
    DIAdem ASCII Export.zip ‏5 KB

  • How to add colors to a CSV file?

    Hi there,
    I'm exporting data to a CSV file using printWriter.
    Question: is it possible to add colors, bold text or stretch the length of a column in the produced CSV file?
    This, of course, should be the end result of the file (not do it when the file is open)
    Thank you!

    xianwinwin wrote:
    Question: is it possible to add colors, bold text or stretch the length of a column in the produced CSV file?Of course if you assumed that you'd be looking at the file with a fixed-width font, you could insert a bunch of tabs or spaces to get columns to match up, but I strongly advise you not do that. I think of CSV as a poor-man's excel data file or perhaps a flat database file, but most importantly it holds data in a standard format that can be read and manipulated by many different programs, including ones you write yourself. It is not meant to be for pretty visualization. Try to pretty it up and you possibly ruin it's main reason for existing. For nice visualization I'd create a small app that read the CSV, formatted it nicely and either displayed the data or stored it in some pretty format as a non-CSV file.

  • How to export data to .csv file  ?

    Hi guys, I know this topic is covered many times in this forum. How do I export my table data to a csv file when my data already has some , (commas) in it. For example, I have two columns in a table, ID and DESCRIPTION. The DESCRIPTION column has data which has , (commas) in it. When I export the data using the following script, I see multiple columns in my excel file as DESCRIPTION has data with commas and each part of it is shown as a separate column in excel sheet.
    set heading off
    set echo off;
    set pause off;
    spool tbl_account.csv;
    select To_Char(ID)|| ',' || To_Char(Description) From tbl_account;
    spool off;
    Thanks in advance

    Have you thought about putting those values between quotation marks?
    "test,test" for example would end up in one cell.
    C.

  • HT2486 how can I export the contact book data to a csv file for editing?

    how can I export the contact book data to a csv file for editing?

    You can edit a card right in Contacts. No need to export and re-import.
    Select a name and on the right side, click the Edit button:

  • How can we export table data to a CSV file??

    Hi,
    I have the following requirement. Initially business agreed upon, exporting the table data to Excel file. But now, they would like to export the table data to a CSV file, which is not being supported by af:exportCollectionActionListener component.
    Because, when i opened the exported CSV file, i can see the exported data sorrounded with HTML tags. Hence the issue.
    Does someone has any solution for this ... Like, how can we export the table data to csv format. And it should work similar to exporting the data to excel sheet.
    For youre reference here is the code which i have used to export the table data..
    ><f:facet name="menus">
    ><af:menu text="Menu" id="m1">
    ><af:commandMenuItem text="Print" id="cmi1">
    ><af:exportCollectionActionListener exportedId="t1"
    >title="CommunicationDistributionList"
    >filename="CommunicationDistributionList"
    >type="excelHTML"/> ---- I tried with removing value for this attribute. With no value, it did not worked at all.
    ></af:commandMenuItem>
    ></af:menu>
    ></f:facet>
    Thanks & Regards,
    Kiran Konjeti

    Hi Alex,
    I have already visited that POST and it works only in 10g. Not in 11g.
    I got the solution for this. The solution is :
    Use the following code in jsff
    ==================
    <af:commandButton text="Export Data" id="ctb1">><af:fileDownloadActionListener contentType="text/csv; charset=utf-8"
    >filename="test.csv"
    >method="#{pageFlowScope.pageFlowScopeDemoAppMB.test}"/>
    ></af:commandButton>
    OR
    <af:commandButton text="Export Data" id="ctb1">><af:fileDownloadActionListener contentType="application/vnd.ms-excel; charset=utf-8"
    >filename="test.csv"
    >method="#{pageFlowScope.pageFlowScopeDemoAppMB.test}"/>
    ></af:commandButton>
    And place this code in ManagedBean
    ======================
    > public void test(FacesContext facesContext, OutputStream outputStream) throws IOException {
    > DCBindingContainer dcBindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    >DCIteratorBinding itrBinding = (DCIteratorBinding)dcBindings.get("fetchDataIterator");
    >tableRows = itrBinding.getAllRowsInRange();
    preparaing column headers
    >PrintWriter out = new PrintWriter(outputStream);
    >out.print(" ID");
    >out.print(",");
    >out.print("Name");
    >out.print(",");
    >out.print("Designation");
    >out.print(",");
    >out.print("Salary");
    >out.println();
    preparing column data
    > for(Row row : tableRows){
    >DCDataRow dataRow = (DCDataRow)row;
    > DataLoaderDTO dto = (DataLoaderDTO)dataRow.getDataProvider();
    >out.print(dto.getId());
    >out.print(",");
    >out.print(dto.getName());
    >out.print(",");
    >out.print(dto.getDesgntn());
    >out.print(",");
    >out.print(dto.getSalary());
    >out.println();
    >}
    >out.flush();
    >out.close();
    > }
    And do the following settings(*OPTIONAL*) for your browser - Only in case, if the file is being blocked by IE
    ==================================================================
    http://ais-ss.usc.edu/helpdoc/main/browser/bris004b.html
    This resolves implementation of exporting table data to CSV file in 11g.
    Thanks & Regards,
    Kiran Konjeti

  • How to extract data from an arbitrary xml file and export in a nice csv file?

    Hallo,
    I'm facing big problems in the use of XML files. I have an
    application which generates XML files with clusters containing arrays
    and scalars like in the example pasted below. My task is to
    read it and export the data in a human-friendly CSV document.
    Since I don't know the actual content of the cluster, I need some kind
    of intelligent vi which goes through the XML file looking for arrays
    and other data structures in order to export them properly in the CSV
    format (columns with headers).
    Thank you
    <Cluster>
    <Name></Name>
    <NumElts>3</NumElts>
    <Array>
    <Name></Name>
    <Dimsize>6</Dimsize>
    <I32>
    <Name></Name>
    <Val>0</Val>
    </I32>
    <I32>
    <Name></Name>
    <Val>1</Val>
    </I32>
    <I32>
    <Name></Name>
    <Val>2</Val>
    </I32>
    <I32>
    <Name></Name>
    <Val>3</Val>
    </I32>
    <I32>
    <Name></Name>
    <Val>4</Val>
    </I32>
    <I32>
    <Name></Name>
    <Val>5</Val>
    </I32>
    </Array>
    <DBL>
    <Name></Name>
    <Val>3.14159265358979</Val>
    </DBL>
    <String>
    <Name></Name>
    <Val>ciao</Val>
    </String>
    </Cluster>
    Solved!
    Go to Solution.

    Thank you again,
    I'm forwarding my vi draft with many comments and an xml file sample.
    Data in cluster is stored according to the LabVIEW schema, infact it is generated by LabVIEW.
    What I'm trying to do is to access the element of the cluster and read their content using the Invoke node and Property node functions. Could you give it a look, there may be something wrong, I'm not able to access cluster children.
    Which funcions should I use? Could you give me an example? You may use the draft I enclosed...
    Then write these data in a csv file
    should be the easier part.
    BODY{font:x-small 'Verdana';margin-right:1.5em}
    .c{cursor:hand}
    .b{color:red;font-family:'Courier New';font-weight:bold;text-decoration:none}
    .e{margin-left:1em;text-indent:-1em;margin-right:1em}
    .k{margin-left:1em;text-indent:-1em;margin-right:1em}
    .t{color:#990000}
    .xt{color:#990099}
    .ns{color:red}
    .dt{color:green}
    .m{color:blue}
    .tx{font-weight:bold}
    .db{text-indent:0px;margin-left:1em;margin-top:0px;margin-bottom:0px;padding-left:.3em;border-left:1px solid #CCCCCC;font:small Courier}
    .di{font:small Courier}
    .d{color:blue}
    .pi{color:blue}
    .cb{text-indent:0px;margin-left:1em;margin-top:0px;margin-bottom:0px;padding-left:.3em;font:small Courier;color:#888888}
    .ci{font:small Courier;color:#888888}
    PRE{margin:0px;display:inline}
      <?xml
    version="1.0" encoding="iso-8859-1" ?>
     <Contents type="Data"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="XMLSection.xsd">
     <section name="beta"
    date="7/31/2009" time="3:43:03 PM" version="1.0">
     <Cluster>
      <Name />
      <NumElts>1</NumElts>
     <Array>
      <Name />
      <Dimsize>4</Dimsize>
     <DBL>
      <Name>number: 0 to 1</Name>
      <Val>0.93317638164326</Val>
      </DBL>
     <DBL>
      <Name>number: 0 to 1</Name>
      <Val>0.79233924020314</Val>
      </DBL>
     <DBL>
      <Name>number: 0 to 1</Name>
      <Val>0.39199947274518</Val>
      </DBL>
     <DBL>
      <Name>number: 0 to 1</Name>
      <Val>0.74817197429441</Val>
      </DBL>
      </Array>
      </Cluster>
      </section>
      </Contents>
    Attachments:
    read_array.vi ‏12 KB

  • How to export data from a spread sheet which has multiple work sheets?

    How to export data from a spread sheet which has multiple work sheets to a single text file with fixed length fields?

    Hello s1,
    saving them as CSV will not give a fixed legth output but, as the naming says, a Character Separated Value file.
    Regards
    Marcus

  • How can I import data from a csv file into databse using utl_file?

    Hi,
    I have two machines (os is windows and database is oracle 10g) that are not connected to each other and both are having the same database schema but data is all different.
    Now on one machine, I want to take dump of all the tables into csv files. e.g. if my table name is test then the exported file is test.csv and if the table name is sample then csv file name is sample.csv and so on.
    Now I want to import the data from these csv files into the tables on second machine. if I've 50 such csv files, then data should be written to 50 tables.
    I am new to this. Could anyone please let me know how can I import data back into tables. i can't use sqlloader as I've to satisfy a few conditions while loading the data into tables. I am stuck and not able to proceed.
    Please let me know how can I do this.
    Thanks,
    Shilpi

    Why you want to export into .csv file.Why not export/import? What is your oracle version?
    Read http://www.oracle-base.com/articles/10g/oracle-data-pump-10g.php
    Regards
    Biju

  • Exporting table data to a CSV file

    hello everyone,
    i need help on exporting table data to a CSV file.
    I have a div element containing the table which displays some data.
    there is a "Export" button just above the table, which if clicked, will export the current data in the table to a .csv file.
    can this be done in jsp? or i need to use servlet?
    also how can i submit the table data only? (as my webpage contiain other data also)
    can anyone provide with some sort of sample code?
    thanks in advance!!

    oops!!
    i just forgot..
    when the user will click on the export button, i want to greet him with a "Save As"
    popup, so that he can specify the filename and location to save the file.
    thanks!!

Maybe you are looking for

  • Sso from webdynpro app (on WAS  2004s ) to BW web template ( on BW portal )

    Guys - We want to give BW Web template(running in 'Y' BW portal server ) as IFrame or URL Link in Webdynpro application ( Running in server X - WAS 2004s). We had setup SSO between java stack of X to Java stack of Y. but when i open url link,it is st

  • Can I stream music to apple tv and airport express at the same time?

    Does anyone know if I can stream music to both AppleTV and Airport Express (speakers) at the same time? I have a TV in my living room and external speakers on my deck and want to stream music to both at the same time so I have the same music playing

  • Saving xlsx files in Yosemite Numbers

    New to MAC. Running a MacBook Pro with Yosemite 10.10.2 and numbers 3.5.2 When I create a spreadsheet in numbers or bring one over from my PC I export it to an Exel document. (all is good so far) I have an xlsx copy of my spreadsheet. When I edit it

  • Spatial Installation problem

    I am new to Spatial. Get a problem: Select sdo_version from dual; Nothing returns. Then, I did select comp_name, status from dba_registry; Spatial: invalid Thanks for help in advance. L.G.

  • IPC (Inter Portlet Communication) and DesktopBackingContext

    I have two portlets: portlet A and portlet B that communicatie using IPC, and I experience problems when accessing the DesktopBackingContext in the portlet that listens to the event. - Portlet A fires a custom event - This event triggers an action in