Script Task to Create a ".CSV" file and save it on SFTP.

I have a sql query that is being pulled from a variable. Using this variable I want to create a .csv and save it on SFTP. I do not want to use any third party tools. I really appreciate if anyone can help me with the code. I do not know coding.  

The solution Visakh has provided still requires third-party tool. And the proposed tool is not integrated in SSIS.
For a better alternative I would recommend the commercial COZYROC
SFTP Task. It is completely integrated in SSIS and very similar to the standard FTP Task.
SSIS Tasks Components Scripts Services | http://www.cozyroc.com/

Similar Messages

  • Create a csv file and send it in an email

    In coldfusion, is it possible to  create a csv file and send it in an email, without ever saving that file on the hard drive?

    Yes, you can create an email attachment without writing a file to disk.  This feature was introduced in CF 8.0.1.
    I've posted a sample to a previous thread on the forums.
    http://forums.adobe.com/message/2123297
    See the CFMAILPARAM section of CF 8.0.1 release notes for attachments without a file on disk.
    http://www.adobe.com/support/documentation/en/coldfusion/801/cf801releasenotes.pdf

  • How to use cfdocument  create a PDF file and save the file in server?

    Hi,
    I want to use cfdocument to create a PDF file and save it in
    the server for other people to download,can you give me a idea how
    to do this.Thanks.
    <cfdocument format = "PDF" pagetype="A4"
    orientation="portrait">
    </cfdocument>
    Mark

    Hi
    <cfdocument filename="" format = "PDF" pagetype="A4"
    orientation="portrait">
    </cfdocument>
    Give the physical path to the filename. You have write
    permission for this folder to create a PDF file.

  • How to Compare 2 CSV file and store the result to 3rd csv file using PowerShell script?

    I want to do the below task using powershell script only.
    I have 2 csv files and I want to compare those two files and I want to store the comparision result to 3rd csv file. Please look at the follwingsnap:
    This image is csv file only. 
    Could you please any one help me.
    Thanks in advance.
    By
    A Path finder 
    JoSwa
    If a post answers your question, please click &quot;Mark As Answer&quot; on that post and &quot;Mark as Helpful&quot;
    Best Online Journal

    Not certain this is what you're after, but this :
    #import the contents of both csv files
    $dbexcel=import-csv c:\dbexcel.csv
    $liveexcel=import-csv C:\liveexcel.csv
    #prepare the output csv and create the headers
    $outputexcel="c:\outputexcel.csv"
    $outputline="Name,Connection Status,Version,DbExcel,LiveExcel"
    $outputline | out-file $outputexcel
    #Loop through each record based on the number of records (assuming equal number in both files)
    for ($i=0; $i -le $dbexcel.Length-1;$i++)
    # Assign the yes / null values to equal the word equivalent
    if ($dbexcel.isavail[$i] -eq "yes") {$dbavail="Available"} else {$dbavail="Unavailable"}
    if ($liveexcel.isavail[$i] -eq "yes") {$liveavail="Available"} else {$liveavail="Unavailable"}
    #create the live of csv content from the two input csv files
    $outputline=$dbexcel.name[$i] + "," + $liveexcel.'connection status'[$i] + "," + $dbexcel.version[$i] + "," + $dbavail + "," + $liveavail
    #output that line to the csv file
    $outputline | out-file $outputexcel -Append
    should do what you're looking for, or give you enough to edit it to your exact need.
    I've assumed that the dbexcel.csv and liveexcel.csv files live in the root of c:\ for this, that they include the header information, and that the outputexcel.csv file will be saved to the same place (including headers).

  • Automator: Create new folders from .csv file and put images inside.

    I have a challenging Automator task to achieve. I need to
    1) create a set of folders labeled with the contents in column A of a csv file. (example: column A1 JoeBrown A2 SuzyBrown A3 JimBrown etc..) resulting in
    3 folders titled JoeBrown, SuzyBrown, and JimBrown
    2) take the image represented by an image number in column B of the same csv file and move that file into the folder that was created (example: A1 JoeBrown gets a folder created by the name JoBrown and column B IMG_1234.jpg is physically moved from within the same folder as the .csv file into the folder created by column A.
    Both the csv and img files would be in the same folder. I have the script to create a set of folders from a csv list just can't complete the moving of files based on the contents of column B.
    SUMMARY: I have a folder containing several images img_0001, img_0002, img_0003 etc. and a csv file that contains columnA a series of names and column B a series of jpg image numbers. I need to have a script that will create folders labeled whatever name is in column A (see the script below. it works great!) then move the images from column B to the folders generated from column A.
    The csv script is:
    tell application "Finder"
      set mgFolder to container of mgCSVfile as string
      repeat with x from 1 to count paragraphs of mgList
        set text item delimiters of AppleScript to ","
        set mgThisList to text items of paragraph x of mgList as list
        set text item delimiters of AppleScript to ""
        set mgTopFolder to item 1 of mgThisList
        if (exists folder mgTopFolder of folder mgFolder) is false then
          make new folder at mgFolder with properties {name:mgTopFolder}
        end if
        set mgNewFolder to (folder mgTopFolder of folder mgFolder) as alias
        repeat with i from 2 to count mgThisList
          if item i of mgThisList is not "" then
            set mgSubFolder to item i of mgThisList
            if (exists folder mgSubFolder of folder mgNewFolder) is false then
              make new folder at mgNewFolder with properties {name:mgSubFolder}
            end if
          end if
        end repeat
      end repeat
    end tell
    Thanks for any help that may come my way.

    This should work
    (assumes a true "," seperated file with only two items per line, i.e.: Test,Test.jpg):
    The Run Shell Script Action is:
    cd "${1%/*}"
    while read line         
    do         
         FolderName=${line%,*}
         ImageName=${line#*,}
         mkdir "$FolderName"
         mv "$ImageName" "$FolderName"
    done < "$1"

  • Function moduls to create csv-file and send it per mail

    Hello,
    we have the following requirement.
    We created an eventhandler.
    Inside this eventhandler we built up an internal table with 1-n entries.
    Now we want to create a csv-file or excel-file in background and send it to the users mailadress.
    Are there standard function modules which we can use for this requirement.
    We can´t download the file directly to the users client with cl_gui_frontend_services because we are not in SAP GUI but in CRM Webclient UI.
    Thank you
    Best regards
    Manfred

    hello,
    thank you.
    a coding example would be very helpfull.
    the internal table shall be added as csv-attachment to the mail and the recipient shall be the current user.
    Thanks a lot in advance.
    Kind regards
    Manfred

  • Powershell script to update a field value (recursively) in sharepoint form a .CSV file and not changing the updated by value

    need to run through a list of old to new data (.csv) file and change them in a sharepoint list - can not make it work
    here is my base attempt.
    $web = Get-SPWeb site url
    $list = $web.lists["List Name"]
    $item = $list.items.getitembyid(select from the items.csv old)
    $modifiedBy = $item["Editor"]
    #Editor is the internal name of the Modified By column
    $item["old"] = "new from the .csv file parsed by power sehll
    $ite.Syste,Update($false);
    $web.Dispose()

    Hi,
    According to your description, my understanding is that  you want to update SharePoint field value from a CSV file recursively.
    We can import CSV file using the Import-CSV –path command, then update the field value in the foreach loop.
    Here is a code snippet for your reference:
    Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
    $csvVariable= Import-CSV -path "http://sp2010.contoso.com/finance/"
    # Destination site collection
    $WebURL = "http://sp2010.contoso.com/sites/Utility/"
    # Destination list name
    $listName = "Inventory"
    #Get the SPWeb object and save it to a variable
    $web = Get-SPWeb -identity $WebURL
    #Get the SPList object to retrieve the list
    $list = $web.Lists[$listName]
    #Get all items in this list and save them to a variable
    $items = $list.items
    #loop through csv file
    foreach($row in $csvVariable)
    #loop through SharePoint list
    foreach($item in $items)
    $item["ID #"]=$row."ID #"
    $item.Update()
    $web.Dispose()
    Here are some detailed articles for your reference:
    http://blogs.technet.com/b/stuffstevesays/archive/2013/06/07/populating-a-sharepoint-list-using-powershell.aspx
    http://social.technet.microsoft.com/wiki/contents/articles/25125.sharepoint-2013-powershell-to-copy-or-update-list-items-across-sharepoint-sites-and-farms.aspx
    Thanks
    Best Regards
    Jerry Guo
    TechNet Community Support

  • I am having a problem creating a CSV file

    I have created CSV files and imported them into Mac's contact book before. For some reason this time its not allowing me to import them because its giving me this message: TEXT FILE IMPORT FAILURE "The selected file does not appear to be a valid comma separated values (csv) file or a valid tab delimited file. Choose a different file."
    The text when I copy paste it even comes out deliniated and everything.
    <Emails Edited By Host>

    Hi,
    You need to quote your path.
    Import-Csv 'C:\Scripts\PowerShell Scripts\newusers.csv'
    Don't retire TechNet! -
    (Don't give up yet - 12,950+ strong and growing)

  • Using csv files and automatic activation

    We have setup our hybrid with Office 365, how can I use the csv file to migrate and activate the users at the same time ? I can migrate the users but they are not activate otomatically. Actually we plan to ONLY activate exchange not the other products
    like Lync, Sharepoint..at the moment.

    Hi,
    Do you migrate mailboxes to Exchange Online with a staged migration?
    When you migrate mailboxes to Exchange Online with a staged migration, you can create a CSV file to create a migration batch.
    After a migration batch has finished running, you need to convert the on-premises mailboxes in the migration batch to mail-enabled users by downloading related scripts and run it.
    I'm afraid there is no way to migrate and activate the users at the same time using a single CSv file.
    Here is a related article for your reference.
    http://technet.microsoft.com/en-GB/library/jj874018(v=exchg.150).aspx
    Best regards,
    Belinda Ma
    TechNet Community Support

  • Loading a CSV file and accessing the variables

    Hi guys,
    I'm new to AS3 and dealt with AS2 before (just getting the grasp when the change it).
    Is it possible in AS3 to load an excel .csv file into Flash using the URLLoader (or ???) and the data as variables?
    I can get the .csv to load and trace the values (cell1,cell2,cell3....) but I'm not sure how to collect the data and place it into variables.
    Can I just create an array and access it like so.... myArray[0], myArray[1]? If so, I'm not sure why it's not working.
    I must be on the completely wrong path. Here's what I have so far....
    var loader:URLLoader = new URLLoader();
    loader.dataFormat = URLLoaderDataFormat.VARIABLES;
    loader.addEventListener(Event.COMPLETE, dataLoaded);
    var request:URLRequest = new URLRequest("population.csv");
    loader.load(request);
    function dataLoaded(evt:Event):void {
        var myData:Array = new Array(loader.data);
        trace(myData[i]);
    Thanks for any help,
    Sky

    just load your csv file and use the flash string methods to allocate those values to an array:
    var myDate:Array = loader.data.split(",");

  • Issue when creating a CSV file

    Stupid issue but I've tried to fix it all day and it's not working...
    I need to create a CSV file made up of 3 columns, 2 number and 1 char. The char column is a company name that has spaces in it. When I run the query in SQL Developer, the char column looks fine. When I run in in BiPub as a CSV, I get double-quotes around the char column. It looks fine if I would look at it as DATA or any other format.
    I can't use the REPLACE function because there's nothing wrong with the data.
    We're using BI Pub v.10.1.3.4.
    Any thoughts?
    Thanks!!
    Kris

    First I tried using a basic rtf file and just selected CSV as the type. Then I tried using the 'e-text template' and selecting CSV, same result. Now I'm trying to use an .xsl file instead of a .rtf to see if that works.
    Kris

  • How to create a csv file with NCS attributes?

    Hi
    i installed Cisco Prime NCS and trying to perform bulk update of device credentials with csv file.
    How to create a csv file with all required attributes?
    This is part of NCS online help talking about this topic:
    Bulk Update Devices—To update the device credentials in a bulk, select Bulk Update Devices from the Select a command drop-down list. The Bulk Update Devices page appears.You can choose a CSV file.
    Note        The CSV file contains a list of devices to be updated, one device per line. Each line is a comma separated list of device attributes. The first line describes the attributes included. The IP address attribute is mandatory.
    Bellow is test csv file i created but does not work:
    10.64.160.31,v2c,2,10,snmpcomm,ssh,zeus,password,password,enablepwd,enablepwd,60
    10.64.160.31,v2c,2,10,snmpcomm,ssh,zeus,password,password,enablepwd,enablepwd,60
    The error i am getting while importing this file:
    Missing mandatory field [ip_address] on header line:10.64.160.31,v2c,2,10,snmpcomm,ssh,zeus,password,password,enablepwd,enablepwd,60
    Assistance appreciated.

    It looks like the IP address field is incorrectly set.,
    It should be as follows
    {Device IP},{Device Subnet Mask}, etc etc
    so a practical example of the aboove could be (i dont know if this is completely correct after the IP address / Subnet Mask)
    10.64.160.31,255.255.255.0,v2c,2,10,snmpcomm,ssh,zeus,password,password,enablepwd,enablepwd,60
    below is a link to the documentation
    http://www.cisco.com/en/US/docs/wireless/ncs/1.0/configuration/guide/ctrlcfg.html#wp1840245
    HTH
    Darren

  • How to create a .CSV file & place it  in Application server

    Hi All,
    I have a requirement like .
    1.Create a .CSV file by using report output data.
    2.The .csv file should be placed in application server.
    When user will execute the report,
    automatically a .csv has to generate and that should be available at application server.
    points will be rewarded.
    Thanks,
    Anil

    Hi,
      Whatever the final output internal table is there  loop that
    DATA : begin of i_final occurs 0,
                  field1(20),
                  field2(20),
                end of i_final.
    DATA : v_filepath (200) TYPE c Value '/data/sapdata/test.csv' .
    DATA : begin of i_file_data occurs 0,
                  Rec(500),
                end of i_file_data.
    LOOP AT i_final.
    CONCATENATE i_final-field1  i_final-field2  INTO i_file_data-rec SEPARATED BY ','.
    APPEND i_file_data.
    CLEAR  i_file_data.
    ENDLOOP.
    OPEN DATASET v_filepath IN OUTPUT  FOR TEXT MODE.
    LOOP AT i_file_data.
      TRANSFER  i_file_data-rec TO  v_filepath.
    ENDLOOP.
    CLOSE v_filepath.
    To check the file goto Tcode->AL11>data/sapdata/test.csv.

  • Importing CSV file and parsing it

    First of all I am very new to writing powershell code.  Therefore, my question could be very rudimentary, but I cannot find an answer, so please help.
    I'm trying to read a CSV file and parse it.  I cannot figure out how to access nth element without hardcoding its name.
    $data = Import-Csv $file   #import CSV file
    # read column headers (manually read the first row of the data file, or import it from other source, or ...)
    $file_dump = Get-Content $file  #OK, I'm sure there is another way to get just the first line, but that's not relevant
    $name_list = $file_dump[0].split(",")
    # access element
    $temp = $data[$i].Name  # works - but that's HARDCODING the column name into the script - what if someone changes it?
    #but what I want to do is
    $temp = $data[$i].$name_list[0]
    How do I do this in PowerShell?

    So you're asking how to get the first data point from the first column, no matter what the header is?
    Why won't you know what your input file looks like?
    You can always drop the first line of the file to remove the existing headers and then use the -Header parameter of Import-Csv to give yourself known headers to reference (this will only work if you know how many columns to expect, etc etc etc).
    http://ss64.com/ps/import-csv.html
    Don't retire TechNet! -
    (Don't give up yet - 13,085+ strong and growing)

  • Getting CLOB fron Database then creating a CSV File

    Hi,
    I am trying to read a CLOB for the DB in my Backing Bean with the help of EJB.
    The code in my backing bean is:
    char[] strReportContent = reportObj.getReportText();The API where the accessors for getReportText() is;
      @Lob
      @Column(name="REPORT_TEXT")
      public char[] getReportText()
        return reportText;
      public void setReportText(char[] reportText)
        this.reportText = reportText;
      }The problem is that when I do a system out on strReportContent I get a garbage value and not what is in the DB.
    Please Help.
    Then to render it on the CSV the code is:
      // Init servlet response.
          response.reset();
          response.setContentType("plain/text");
          // response.setContentLength(input.available());
          response.setHeader("Content-disposition",
                             "inline; filename=\"" + selectedReportId.getReportName() + "\"");
          output =
              new BufferedOutputStream(response.getOutputStream(), DEFAULT_BUFFER_SIZE);
    char[] strReportContent = reportObj.getReportText();
    output.write(strReportContent.toString().getBytes(), 0, strReportContent.length);

    Hi,
    I am not removing any zeroes . I created the same file in .txt format and XI was able to write the value 008.2010 to the txt file.
    I suppose this has somehting to do with excel file properties . By default when we add 008.2010 in the excel sheet , it takes only 8.201. We need to change the format to "text" manually in the excel file to take in zeroes as well.
    So , i really dont know how to make sure that the excel file properties does not truncate zeroes while XI is creating the CSV file.
    Regards
    Vinay P.

Maybe you are looking for

  • MDM 5.5 SP6 install and post-install config - SLDREG related question

    Hello, I've just installed MDM 5.5 SP6 on Oracle/Solaris and have the server running with no problems, repositories loaded, etc. I do receive the following error in the MDM Console which I understand to mean the sldreg utitlity cannot be found. Error

  • Dramatic increase in drop calls since update 2.2.1

    Has anyone else seen a dramatic increase in dropped calls since they installed the latest software update. My phone is quickly becoming unusable. I would estimate every 2 of 3 calls are dropped.

  • How to call force render on custom effect from AEGP?

    Hi All,           I want to call a force render on my custom effect from AEGP. I tried setting PF_OutFlag_Force_Rerender flag in PF_CMD_COMPLETELY_GENERAL (Called from AEGP via AEGP_EffectGeneric()). But it did not work. Is there any other way to for

  • Skype keeps crashing when I open up Vindictus.

    For some reason when I open the game Vindictus my Skype suddenly stops working and forces me to close the program. I've tried uninstalling and re-installing multiple times. I've run it as an Admin. I've uninstalled the Skype (app) application from th

  • "Update not available for this id" after Yosemite upgrade

    Hello, I have a MacBook Pro (15-inch, Mid 2010) 2,53 GHz Intel Core i5. I upgraded O/S from Maverick to Yosemite. Now I try to perform latest update, and iMovie, Numbers, Keynote, Pages are listed in the Update list. However each time I try to update