Dynamicall create csv files and zip them

Apex version - 4.2
I have some data in the database. I want to generate multiple csv files dynamically from those data. Then zip the csv files together to provide it to the end user.
Can anybody suggest with the approach that could be followed.
Thanx in advance !

Find some code to generate the csv, for instance Export and save result set in CSV format using UTL_FILE
Find some code to zip the files/blobs, for instance http://technology.amis.nl/2010/06/09/parsing-a-microsoft-word-docx-and-unzip-zipfiles-with-plsql/
Combine the two pieces
Done

Similar Messages

  • I am having problems creating PDF file and downloading them

    I am having problems creating PDF file and downloading them

    Hi Randy Keil,
    You might need to sign up with your Adobe ID and password at "https://cloud.acrobat.com/convertpdf"
    Then you can choose the desired files to create the PDF.
    Now, let me know what error message do you get while doing the same.
    What kind of files are you trying to convert to PDF?
    Have you checked with your internet connection and tried using a different browser?
    Hope to get your response.
    Regards,
    Anubha

  • 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

  • Uploading csv files and reading them from server

    I want to read a csv file.From Flex i am able to select the
    file but when i pass it to the server using struts
    FileUploadInterceptor , am not able to pass the file to the
    server.FileUploadInterceptor in struts2 processes the request only
    if its instance of MultiPartRequestWrapper.Is there any way in Flex
    where i can pass the request as a instance of this.Is there any
    other way in which i can read the file from the server after
    uploading it through flex.Code is as follows :
    1)MXML File :
    ?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute">
    <mx:Script>
    <![CDATA[
    import ImportData;
    import flash.net.FileReference;
    import flash.net.FileFilter;
    import flash.events.IOErrorEvent;
    [Bindable] var fileRef:FileReference = new FileReference();
    private function openFileDialog():void{
    fileRef.addEventListener(Event.SELECT, selectHandler);
    fileRef.addEventListener(Event.COMPLETE, completeHandler);
    fileRef.addEventListener(DataEvent.UPLOAD_COMPLETE_DATA
    ,uploadCompleteHandler);
    fileRef.addEventListener(IOErrorEvent.IO_ERROR,onIOError);
    try{
    var textTypes:FileFilter = new FileFilter("Text Files
    (*.txt,*.csv)","*.txt;*.csv");
    var allTypes:Array = new Array(textTypes);
    //var success:Boolean = fileRef.browse();
    var success:Boolean = fileRef.browse(allTypes);
    catch(error:Error){
    trace("Unable to browse for files.");
    private function onIOError(event:IOErrorEvent):void {
    trace("In here"+event.text);
    trace("In here"+event.toString());
    // when a file is selected you upload the file to the upload
    script on the server
    private function selectHandler(event:Event):void{
    //var request:URLRequest = new URLRequest("/importAction");
    var request:URLRequest = new URLRequest("
    http://localhost:8080/pack1/importAction.action");
    try
    fileRef.upload(request);
    catch (error:Error)
    trace("Unable to upload file.");
    private function completeHandler(event:Event):void{
    trace("uploaded");
    // dispatched when file has been uploaded to the server
    script and a response is returned from the server
    // event.data contains the response returned by your server
    script
    public function uploadCompleteHandler(event:DataEvent):void
    trace("uploaded... response from server: \n" +
    String(event.data));
    ]]>
    </mx:Script>
    <mx:Button label="Import" id="importBtn"
    click="openFileDialog()" height="20" width="90"
    styleName="buttonsOnSearchBar"/>
    <mx:ComboBox x="23" y="44" borderColor="#ff0000"
    themeColor="#ff0000"></mx:ComboBox>
    </mx:Application>
    2)struts.xml file
    <struts>
    <package name="pack1"
    extends="struts-default,json-default">
    <global-results>
    <result name="error" type="json"></result>
    </global-results>
    <global-exception-mappings>
    <exception-mapping result="error"
    exception="java.lang.Throwable"/>
    </global-exception-mappings>
    <action name="importAction"
    class="routing.ImportAction">
    <interceptor-ref name="fileUpload"/>
    <interceptor-ref name="basicStack"/>
    <result name="success" type="json"></result>
    </action>
    </package>
    </struts>
    3)Action Class
    package com.om.dh.orderrouting.action;
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileNotFoundException;
    import java.io.FileReader;
    import java.util.ArrayList;
    import java.util.StringTokenizer;
    import org.apache.log4j.Logger;
    import com.opensymphony.xwork2.ActionSupport;
    public class ImportAction extends ActionSupport{
    private String contentType;
    private File upload;
    private String fileName;
    private String caption;
    private static final Logger logger =
    Logger.getLogger(ImportAction.class);
    @Override
    public String execute() throws Exception {
    * Read File Line by Line.. If the file has more than one
    word separated by comma
    * return error.
    ArrayList<String> symbolList = new
    ArrayList<String>();
    try{
    BufferedReader reader = new BufferedReader(new
    FileReader(upload));
    String line =null;
    String symbol=null;
    while((line=reader.readLine())!=null){
    StringTokenizer tokenizer = new StringTokenizer(line,"\t");
    symbol = tokenizer.nextToken();
    if(symbol!=null) symbol = symbol.trim();
    if(symbol.length()>0)
    symbolList.add(symbol);
    }catch(FileNotFoundException fne){
    if(logger.isDebugEnabled())
    logger.debug("File NotFount ", fne);
    for(String symbol1:symbolList)
    System.out.print(symbol1+" ");
    return SUCCESS;
    public String getUploadFileName() {
    return fileName;
    public void setUploadFileName(String fileName) {
    this.fileName = fileName;
    public String getUploadContentType() {
    return contentType;
    public void setUploadContentType(String contentType) {
    this.contentType = contentType;
    public File getUpload() {
    return upload;
    public void setUpload(File upload) {
    this.upload = upload;
    public String getCaption() {
    return caption;
    public void setCaption(String caption) {
    this.caption = caption;
    public String input() throws Exception {
    return SUCCESS;
    public String upload() throws Exception {
    return SUCCESS;

    quote:
    Originally posted by:
    ived
    tried this but does not work...
    var request:URLRequest = new URLRequest("
    http://localhost:8080/pack1/importAction.action");
    request.contentType="multipart/form-data";
    in the interceptor it expects the request to be instanceof
    MultiPartRequestWrapper...
    Further the document says that FileReference.upload() and
    FileReference.download() methods do not support the
    URLRequest.contentType and URLRequest.requestHeaders parameters.
    Any help ??

  • 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

  • Creating an XLS file and Zip it

    Hi All,
    we have a requirement where in we have to create an XLS file from internal table. This xls file then has to be zipped and mailed.
    If anyone knows how to create an xls file and zip it in WebDynpro, without using OPEN, CLOSE DATA SET etc, Please let us know. It will be of great help.
    Thanks,
    Anand

    >2) Convert the STRING format to XSTRING format by using the FM SCMS_STRING_TO_XSTRING.
    Actually you should use CL_BCS_CONVERT=>STRING_TO_XSTRING now.
    >3) Use the method COMPRESS_BINARY of class CL_ABAP_GZIP to compress the XSTRING file.
    You probably want to use CL_ABAP_ZIP instead of CL_ABAP_GZIP.  CL_ABAP_GZIP only does compression, which is fine for storing a single packet of data in the database.  However CL_ABAP_ZIP is better suited for mult-part zip (multiple inner files).
    >4) Use the method SEND_WEB_MAIL of class CL_HRRCF_SERVICES_MAIL to mail across the zipped contents.
    This seems to be an HR specific class. Better to use the cross application, NetWeaver provided functionality for sending mail - CL_BCS.

  • 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

  • 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"

  • Is there a way to select a certain box of elements from a csv file and read that into LabVIEW?

    Hello all, I was wondering if there was a way to select only a certain "box" of elements from a .csv file in LabVIEW? I have LabVIEW 2011 and my main goal is to take two arrays and graph them against each other. I can import the .csv file just fine and separate each row and each column to be its own, but say I have an 8X8 but want to graph the middle 4X5 or something like that. Is there any way to extract an array without starting at the beginning and without ending at the end? Thank you in advance.
    Solved!
    Go to Solution.

    Hi Szklanam,
    as a CSV file is just a TXT file with a different suffix you can read a certain number of lines of that file. So you can limit the number of rows in your resultung array. To limit the number of columns you still have to use ArraySubset, so maybe it's a lot easier to read the full CSV file and pick the interesting spots with ArraySubset...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • How do I process multiple files and turn them from raw to jpeg

    How do I process multiple files and turn them from raw to jpeg. Ive tried and it seems to go through the files but doesnt seem to process them or store them in the selected folder

    Yes that was the first thing I did. Then I used the process multiple files and selected a new folder to put them in and selected use open files and selected to turn them into jpeg. The images flash on the screen like they are being processed, but the folder never appears in library. Is it possible because there are a couple 16 bit files open that this corrupts the task. Do I need to create the folder first. Will elements not create the folder on its own.
    Thanks Vince

  • How to configure sync rules involving a CSV file and portal self service

    Hello,
     I need to configure some FIM sync rules for the following scenario:
     User account details are entered from a HR CSV file and exported to AD  Users have the ability to modify their own AD attributes in the
    FIM portal (there is not a requirement for them to view their  HR CSV data in the portal). The FIM portal modifications will be exported to AD as expected.  
    My setup is as follows:
    CSV file - name, last name, employee ID, address.
    CSV MA - has direct attribute flows configured in the MA between the data source and MV Portal self service attributes –      
    users can edit mobile, display name and photo
    I've also set the CSV MA as precedent for the attributes
    FIM MA – attribute flows defined for MV to Data Source as usual (i.e. firstname to firstname, accountname to accountname, etc).
    AD MA – no attribute flows defined as inbound and outbound sync rules have been configured in the portal using the Set\MPR\Triple.
    I’m thinking of using the following run profiles:
    CSV MA – full import and delta sync (imports HR data)
    FIM MA –  export and delta import (imports portal changes)
    FIM MA – delta sync (syncs any portal changes)
    AD MA – export and delta import
    If my understanding is correct this should sync HR data from CSV to AD, as well as user attribute self service updates from the portal to AD.
    If I wanted to just do a HR CSV sync could I get away with just steps 1 & 4 ? (presumably not as my rules are in the FIM portal?)
    If I wanted to do just a portal sync, could I get away steps 2-4?
    Any advice on how to improve my setup is much appreciated - cheers
    IT Support/Everything

    The truth is that your design should be done in the way that it doesn't matter which profiles in which order you will execute. At the end, if you will run all import, synch and export profiles on each data source you should get same result. This is beauty
    of synch engine here.
    Your steps from 1-4 will synch data to your data sources and at the end will give you expected result. But not because of the order you are executing them but because of correct attribute flows. If flows from CSV file and from FIM portal might be done for
    the same attributes you need to think also about attribute precedence.   
    Tomek Onyszko, memberOf Predica FIM Team (http://www.predica.pl), IdAM knowledge provider @ http://blog.predica.pl

  • 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).

  • 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(",");

  • Read from csv file and plot particular columns

    Hello,
    I`m a new user of Labview and here it comes...my first major problem.
    Maybe this has been discussed before. I’ve made a search to solve my problem first but I couldn`t find anything helpful so I `ve decided to post a new message.
    So here is my problem:
    I`m working in a small semiconductor lab where different types of nitrides are grown using proprietary reactor. The goal is to read the collected csv files from each growth in Labview and plot the acquired data in appropriate graphs.
    I have a bunch of csv files and I have to make a Labview program to read them.
    The first part of my project I`ve decided to be displaying the csv file (growth log file) under labview (which I think works fine).
    The second one is to be able to plot particular columns from the recipe in graphs in Labview (that one actually gives me a lot of trouble):
    1. Timestamp vs Temperature /columns B and D/
    2. Timestamp vs Gas flow /columns L to S/
    3. Timestamp vs Pressure /columns E,K,T,U,V/
    I`ve got one more problem. How can I convert the Timestamp shown in csv file to human readable date in labview? This actually is a big problem, because the timestamp is my x axis and I want to know at what time a particular process took place and I also want to be able to see the converted timestamp when displaying csv file at first. I`ve read a lot about time stamping in excel and timestamp in labview but I`m still confused how to convert it in my case.
    I don`t have problems displaying csv file under Labview. My problems are with the timestamp and the graphs.
    Sorry for my awful English.  I hope you can understand my problems since English is not my mother language. 
    Please find the attached files.
    If you have any ideas or suggestions I`ll be more than happy to discuss them.
    Thank you in advance.
    Have a nice day! 
    Attachments:
    growth log.csv ‏298 KB
    Read from growth log.vi ‏33 KB

    Hello again,
    I`m having problems with converting the first column in the attached above file Growth Log.csv.
    I have a code converting xl timestamp to time and using Index Array traying to grab a particular column out of it but the attached file is written in strings so I guess I have to redo it in array but I don`t know how.Would you help me with this one?
    Attachments:
    Xl Timestamp to Time.vi ‏21 KB

  • Cannot create PS file and PDF in Framemaker 9

    I'm using Version 9.0p196.
    When I used the "Advanced Save" to save an .fm file to a pdf, I got the message "The specified printer 'N/A' cannot be found, use printer 'Adobe PDF' instead. After I click OK, it said "cannot create PS file", and "failed to create PDF file.
    It worked fine before.This problem was occurred after I copied some fonts to the following locations:
    C:\Windows\Fonts
    and
    C:\Program Files\Adobe\FrameMaker9\fminit\fonts\adobe
    Those fonts are:
    timesbd.ttf
    times.ttf
    HelveticaWorld-Regular.ttf
    HelveticaWorld-Italic.ttf
    HelveticaWorld-BoldItalic.ttf
    HelveticaWorld-Bold.ttf
    I have no idea if that's the cause of the problem. Does anyone know?
    By the way, the FM 9 is running on XP.
    Thanks,
    Meggie

    Meggie,
    You may or may not have created a mess with fonts. I would try not to have duplicate fonts, it is totally sufficient to have them in C:\Windows\Fonts.
    But your FrameMaker verson is definitely four (4) patches behind. The current version is 9.0.4 (9.0p255) and you can get the updaters here:
    http://www.adobe.com/support/downloads/product.jsp?product=22&platform=Windows
    You have to install them one after another.
    Some of the patches improved the Save as PDF feature.
    For further communication, please add your OS version and Acrobat version.
    - Michael

Maybe you are looking for

  • How do I find the serial number of my stolen macbook?

    I recently had stolen my macbook, macbook pro and iphone....and other than retrieving the MEID number of my Iphone, I did not have the serial numbers of the macbooks listed anywhere and I also bought these used online so I did not have a receipt with

  • How to insert new line in the copied schema with transaction code PE01?

    Dear Experts,          I have copied HKT0 to ZKT0 , i want to insert new line between  line 150 and line 160 in ZKT0, I don't know how to insert new line 160, who can tell me ?          Looking forward to your reply. Best Regards, Merry

  • Problem removing old versions with customization wizard 8

    I'm trying to deploy Acrobat Reader 8 to our XP Professional desktops via Active Directory software installation (Windows Server 2003 domain) I have obtained the MSI release of Reader 8, customised it using Adobe Customization Wizard 8, and deployed

  • Bring window to front - appactivate does not help :(

    Hello I am coding with vbscript. I have a need to make certain that sendkeys commands are sent to the proper program. I can use this to activate a window: success = WshShell.appactivate("MyProgram") if success then WshShell.sendkeys "(% ) N" But in W

  • Capturing UserId's

    Hi All, I am creating a webdynpro report for displaying KM documents and hitscount. In that i want to capture the UserId's from portal and display it. How can i capture it? Is there any code samples for that? Regards, Divya