ADF: How to manage the value zero when downloading the csv file

Dear all,

I'm new in the ADF and use 12.2.1. I am downloading of data in the database using af table: inputfile and CSVParser class. Data download correctly in the database where all columns are met, but whenever the csv file has value null (empty) in his column, then CSVParser class does not recognize it and get the next value of columns and assign the previous column. I also tried another one that uses a different class to download date but not get success.

For Ex:

ID name Dept

1 abc Dept1

2 cde Dept2

3 Dept3

In example above two first line are perfectly inserted in the table while the third line Id goes to ID column, due to the value of the column name is null class CSVParser does not recognize it and put Dept3 in the name column.

Please help how to handle this.

Thanks in advance.

Kind regards

Hello

Try with this

UploadedFile file = (UploadedFile)valueChangeEvent.getNewValue();
InputStream is = null;
BufferedReader br = null;
try {
    is = file.getInputStream();
    br = new BufferedReader(new InputStreamReader(is, "UTF-8"));
    String line = "";
    while ((line = br.readLine()) != null) {
         String[] csvCols = line.split(",");
         // do somethinig smart with csvCols
    }
}finally{
    if (br != null) try{br.close();}catch(Exception ex){br = null;}
    if (is != null) try {is.close();} catch(Exception exxx){is = null;}
}

Tags: Java

Similar Questions

  • How to manage the image files used in PDF forms

    With LiveCycle, I created an interactive form for requests of Help Desk-type and the form works perfectly. I tested it and everything works. See the property. Hide, clear the fields. And all other behaviors I added with the Action Builder.

    As a final design feature, on my local machine at work, I've added a header image (which is in My Documents > my pictures). I have tested locally and downloaded the form in Sharepoint and tested from there, and from what I can remember, the form went well. The header was intact. So I assume that type of image has been incorporated somehow.

    Then I put the House file and opened it and - Voila! -No header image!

    That's happened?

    The image files need to be downloaded and the path relative to the location of the file? For me, it doesn't seem to be a huge problem. Something more. I can probably download the image to a location in Sharepoint, and then set the path to the image in the XML file.

    But I would like to hear the experiences of those who have used image files in their LiveCycle Forms.

    Post edited by: ashish gupta. to make the title more descriptive and added a few tags.

    In the palette object make sure you of incorporate Image data is checked.

  • How to generate the CSV file by coil

    Hello
    While running the script file Unix spool, it will show the output in Unix.
    And the file is created with query results from nd.
    I don't want the result expected in CSV file.

    set pagesize 10000
    the value of colsep «»
    Set feedback off
    set the position
    trigger the echo
    coil /home/tata/time.csv
    Select * from emp;
    spool off
    set echo on
    topic on the value
    Set of feedback on

    Thank you
    Lony

    lony wrote:
    I tried the sub query but still, it shows the output
    How to stop the putput.

    set pagesize 10000
    the value of colsep «»
    termout off Set
    Set feedback off
    set the position
    trigger the echo

    coil /home/tata/time.csv

    spool off
    Set termout on
    set echo on
    topic on the value
    Set of feedback on

    Place these commands alongwith your query into a file and then run it from the SQLPlus command line.
    There is no way the query statement delete appear in file queued if stuck directly into the SQLplus command prompt.
    How to remove the sql statement in the output of the coil?

  • How to get the CSV file, RTF model output DATA

    Hi, Jorge

    Thanks for your help.

    as in the link you gave the model RTF can have the type of output CSV DATA but in the preview, I see only html, powerpoint, pdf, html, excel.

    How to see the result in SCV, DATA format using my RTF model do I have to do a specific design for these outputs.

    Thnaks in advance

    This is because it has been preconfigured with these outputs.
    Edit and add types of outputs more simply go to:

    1. change your report
    2. click on 'Display list' (upper right corner)
    3. click on the "output formats" (corresponding to your page layout) and
    4. check the formats (add) additional output you want your report to have.

    see you soon

    Jorge

  • How to download the Csv file with column headers

    Hi all

    This is pavan, using Apex version 4.2.3


    I am trying to download the csv file I followed this link , and I'm able to download excel with headers, when I try to download with headers of this error "'ORA-01858: a non-digit character was found here where was waiting for a digital" I searched in google but could not find the right solution, "


    can anyone help on this please.

    Thanks in advance,


    Kind regards

    Pavan

    This article is 6 years old.

    You should study the solutions that are available for APEX 4.2: data loader or the 'Excel2Collection' plugin (which also manages the CSV files).

    Data Loader

    It is a wizard that generates an Assistant for your application.

    Excel2Collection

    You will use the Excel2Collection (in a single process) to convert the BLOB in a Collection

    Then, in a 2nd address), you just do a "INSERT...". SELECT statement.  Add ' where seq_id > 1 "for files with a header.

    MK

    PS - Use the "EXECUTE IMMEDIATE" article is not necessary.

  • How to assign a value zero if the value is null.

    I have a package, procedure and many functions. I'm trying to get the result of DBMS to list a value for each, if it is null, assign it a zero and move.
    I can't find examples where I can do. Any ideas on how I can assign a zero when there is no value in the table?
    CREATE OR REPLACE PACKAGE emp_net_pay IS
      PROCEDURE emp_tot_sal  (v_empno IN NUMBER);
      FUNCTION find_emp      (v_empno IN NUMBER) RETURN BOOLEAN;
      FUNCTION tot_sal_com   (v_empno IN NUMBER) RETURN NUMBER;
      FUNCTION bef_tax_ded   (emp_no IN NUMBER)  RETURN NUMBER;
      FUNCTION temp_sal_btd  (emp_no IN NUMBER)  RETURN NUMBER;
      FUNCTION tax_emp_sal   (emp_no IN NUMBER)  RETURN NUMBER;
      FUNCTION sal_aft_tax   (emp_no IN NUMBER)  RETURN NUMBER;
      FUNCTION aft_tax_ded   (emp_no IN NUMBER)  RETURN NUMBER;
      FUNCTION tot_net_sal   (emp_no IN NUMBER)  RETURN NUMBER;
    END emp_net_pay;
    /
    CREATE OR REPLACE PACKAGE BODY emp_net_pay IS
    --Procedure calculates totals: Salary plus commission
    PROCEDURE emp_tot_sal (v_empno IN NUMBER)
    IS
      v_tot_sal  NUMBER;
      v_bef_ded  NUMBER;
      v_temp_sal NUMBER;
      v_tot_tax  NUMBER;
      v_sal_tax  NUMBER;
      v_aft_ded  NUMBER;
      v_net_sal  NUMBER;
     BEGIN
      v_tot_sal  := tot_sal_com (v_empno);
      v_bef_ded  := bef_tax_ded (v_empno);
      v_temp_sal := temp_sal_btd(v_empno);
      v_tot_tax  := tax_emp_sal (v_empno);
      v_sal_tax  := sal_aft_tax (v_empno);
      v_aft_ded  := aft_tax_ded (v_empno);
      v_net_sal  := tot_net_sal (v_empno);
         DBMS_OUTPUT. PUT_LINE ('Salary before deductions for employee # ' || v_empno || ' equal: ' || to_char(v_tot_sal,'$999,999.99'));
         DBMS_OUTPUT. PUT_LINE ('Before tax deductions for    employee # ' || v_empno || ' equal: ' || to_char(v_bef_ded,'$999,999.99'));
         DBMS_OUTPUT. PUT_LINE ('Salary minus deductions for  employee # ' || v_empno || ' equal: ' || to_char(v_temp_sal,'$999,999.99'));
         DBMS_OUTPUT. PUT_LINE ('Total taxes for              employee # ' || v_empno || ' equal: ' || to_char
    (v_tot_tax,'$999,999.99'));
         DBMS_OUTPUT. PUT_LINE ('Salary minus taxes for       employee # ' || v_empno || ' equal: ' || to_char
    (v_sal_tax,'$999,999.99'));
         DBMS_OUTPUT. PUT_LINE ('After tax deductions for     employee # ' || v_empno || ' equal: ' || to_char(v_aft_ded,'$999,999.99'));
         DBMS_OUTPUT. PUT_LINE ('Net salary for               employee # ' || v_empno || ' equal: ' || to_char
    (v_net_sal,'$999,999.99'));
     END emp_tot_sal; 
    ..................................................
    Salary before deductions for employee # 7369 equal:      $900.00
    Before tax deductions for    employee # 7369 equal:       $95.34
    Salary minus deductions for  employee # 7369 equal:      $804.66
    Total taxes for                   employee # 7369 equal:       $56.33
    Salary minus taxes for          employee # 7369 equal:      $748.33
    After tax deductions for       employee # 7369 equal:        $8.00
    Net salary for                      employee # 7369 equal:      $740.33
    *******************************************************
    
    alary before deductions for employee # 7654 equal:    $2,650.00
    efore tax deductions for    employee # 7654 equal:
    alary minus deductions for  employee # 7654 equal:
    otal taxes for                    employee # 7654 equal:
    alary minus taxes for          employee # 7654 equal:
    fter tax deductions for       employee # 7654 equal:
    et salary for                      employee # 7654 equal:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            

    NVL looking for [url http://docs.oracle.com/cd/B28359_01/olap.111/b28126/dml_functions_2048.htm]?

  • How to manage the photos Lightroom when using 2 computers, keeping any changes made on one or the other?

    Based on http://forums.Adobe.com/thread/1308132?TSTART=0 I decided to add each question separately:

    Hello, I am very interested in buying Lightroom 5.2. I tried the RC that was missing today. Yet, I have several questions that I can't find really good conclusive answers, I'd like to get an answer before buying LR. Please do not write maybe like this or that (assumptions), because I don't want to start my entire workflow and then realize that I have to change all around, please reply, if you know for sure that something works and you are, preferably, using this method too.

    Is the big question, where I want to especially a conclusive answer:  How to manage the photos Lightroom when using 2 computers, keeping all the changes made on one of them, using the same photos for editing. I'm not going to use DNG. Details: I mainly use my old MacBook Pro, but I wish I could use my PC as it is much better (card: i5 2500K, 16 GB of RAM, SSD, USB3, nVidia GTX 560 TI etc.). I have 2 external HD that I could use, one for backup and one for the actual Photos/changes. I you will probably need to use as my internal HDs are fairly complete and I cannot be the kind of things simply delete or move to one (developer, without loss of music, programs etc.).

    On this basis, how do I save all such Photos folder (pictures and retouching and preferably presets too)?

    According to me, that it should be possible to work cross-platform without having to create a link to the files each time, or without having to keep export/import of the catalog, keeping the single catalog and the picture library on an external drive that is then switched between systems as needed.

    Obvious first requirement is an external drive that is formatted in a way (for example, FAT32) that it can be used on both platforms in read/write mode. Given that, if the catalogue AND folder parent si le catalogue ET le dossier parent images are both set to the same level in a global parent folder, then it should be possible to take advatage of ability of Lightroom to use relative paths instead of absolute paths to detect the images, no matter if the player is named (Mac) or lettering (PC). This is how "export as catalog of ' works, that is, it creates a 'package', alias a parent folder, containing the catalog and a replica of the folder hierarchy to exported along with the catalog images. Take this 'package' to another system (same OS or not) and "it works" even if the drive letter is different or the operating system is different... because the relative path of the image catalogue is always the same.

    I have not tested this cross-platform (if I have between various PC systems with letters of different readers) so for me it's still just a theory, but there may be others who have done this successfully.

  • How to manage what programs open when I turn on my Mac

    How to manage what programs open when I turn on my Mac

    System Preferences > users and groups > Login. Unlock the padlock (bottom left), select the item you want to remove, and then click the sign less.

  • ADF: How to increase the download size of af: inputfile

    Hi all

    I'm new in the ADF and use 12.2.1. I use af:inputfile to download the csv file in the database. It works very well with a small amount of data. But when I download a large file it shows me the error message as below:

    error.jpg

    It is possible to increase the size of download of af: inputfile. Its urgent assistance please.

    Thanks in advance.

    Kind regards

    The maximum size of files that can be downloaded is configured in the web.xml file. the doc:

    Configuration

    Because ADF Faces will temporarily store the files by default, incoming (on disk or in memory), it limits the size of acceptable incoming requests to avoid denial of service attacks that could try to fill a memory disk or a flood lasts with downloaded files. By default, only the first 100 kilobytes in any query will be stored in memory. Once that has been completed, will serve as disk space. Yet once, by default, which is limited to 2 000 kilobytes of disk space for a request for all of the files combined. Once these limits are exceeded, the filter will throw a EOFException . By default, files are stored in the temporary directory used by java.io.File.createTempFile() , which is generally defined by the system property java.io.tmpdir . Of course, this will not be sufficient for some applications, you can set these values using three of servlet context initialization parameters:

    oracle.adf.view.faces.UPLOAD_MAX_MEMORY

    512000

    oracle.adf.view.faces.UPLOAD_MAX_DISK_SPACE

    5120000

    oracle.adf.view.faces.UPLOAD_TEMP_DIR

    / tmp/aDFUploads /.

    
    

    Timo

  • How to manage the SOAP response

    Hello (beginner vCO),

    I use the SOAP Plugin and trying to figure out how to manage the here, a host of SOAP response is the log I get the SOAP response

    [12:53:43.124 2014-05-09] [I] the settings...

    [12:53:43.135 2014-05-09] [I] the available settings:

    [12:53:43.136 2014-05-09] [I] + parameter name: "GetRequestStatusResult", value: "< response >

    < item >

    < ServiceRequestID > SR138917 < / ServiceRequestID >

    OS DEPLOYMENT < ServiceRequestStatus > < / ServiceRequestStatus >

    < ServiceRequestCreated > 09/05/2014-15:20:25 < / ServiceRequestCreated >

    < ServiceRequestCompleted > < / ServiceRequestCompleted >

    MA138921 < CurrentActivity > < / CurrentActivity >

    OS DEPLOYMENT < CurrentActivityTitle > < / CurrentActivityTitle >

    < ActivityStartUTC > 09/05/2014-15:32 < / ActivityStartUTC >

    < ActivityEndUTC > < / ActivityEndUTC >

    < DurationTotalSeconds > < / DurationTotalSeconds >

    < AverageDurationSeconds > < / AverageDurationSeconds >

    < SecondsOffAverage > < / SecondsOffAverage >

    < EstimatedCompletionUTC > < / EstimatedCompletionUTC >

    < / OutputParameters >

    < warning > < / warnings >

    < exceptions > < / Exceptions >

    < / response > '

    It will be better to try and parse text or try and use another method with vCO

    If you haven't done so already, take a look at the action of com.vmware.libarary.soap.processOutParameters.  It is the action that generated the log you have placed in us.  It generates an object Properties (key, value pairs) with the value for each setting that results.

    In your case, assuming that 'outProps' is the result of the above, you can use:

    var getRequestStatusResult = outProps.get ("GetRequestStatusResult");

    And to analyze the code XML with E4X as Ilian said.

  • I would like to know how to manage the ASN.1 encoding/decoding in LabView?

    I would like to know how to manage the ASN.1 encoding/decoding in LabView?

    Hello J,

    in the example given here , it looks like a format simple bytestream...

    You must read the byte stream, get the first and the second byte to decode the data type and length and then read & catalogued according to number of bytes. And then read 2 bytes and so on...

    Encoding will work the same but in reverse

  • How to manage the tv after hdmi to hdmi connection

    I want to connect to my computer windows 7 with tv on my Vizio tv hd tuner. I intend to use the hdmi to hdmi connections. After that I made the connection how to manage the tv without going back to the computer. My TV is in another adjacent room to my computer, sbout 20 ft away. Can I use a wireless mouse to manage the tv? The monitor and tv both appear at the same time? What are other options? Thank you for taking my question and to meet others, I put in the forum. Donnie

    I guess that the xbox 360 is a must for my setup. Thanks for your reply, Donnie

  • How to write the char value as it is in the CSV file

    Hello world

    I create a csv files containing details of the inventory of all products. I am able to create the CSV file utl concepts. My problem starts after the csv file is being created.
    some of the product numbers (although I mean the product number, it is varchar2 data type in the table) is like this 3rd-12, 3rd-54 and so on. I have totally 23 numbers of product like this.
    When the user opens the csv file, it evolves to numbers like this 3.00E - 12, 3.00E - 54. I want to keep the product number because it is like the char value. I tried many methods of submissions and concat.
    But none of them works for me.

    I use oracle 9i.

    Oracle9i Enterprise Edition Release 9.2.0.7.0 - Production
    With partitioning, OLAP and Oracle Data Mining options
    Release 9.2.0.7.0 - Production jserver

    Please help me solve this problem.

    Thanks in advance,

    Vimal...

    >
    When the user opens the csv file, it evolves to numbers like this 3.00E - 12, 3.00E - 54. I want to keep the product number because it is like the char value. I tried many methods of submissions and concat.
    But none of them works for me.
    >
    This is because in Excel, the default format for all cells is "Général" and this format is this:
    >
    Format 'Général' Converts numeric values to numbers, values from date to date, and all remaining values to text.
    >
    If you open a file with CSV extension, then each cell uses the format "General".

    You have two choices, and two of them will require the user to go through the text import wizard dialog boxes.

    Save the file with another extension, for example "txt". Then when a user opens the file they will have to select "Delimited" for the file type in step 1 of the wizard and select "next". They will then choose "Comma" as the separator at step 2 of the wizard and select "next". They must then select 'Text' to the data format column in step 3 of the wizard for these two columns, and then select "Finish".

    The other 'Data-> external data' option in the menu and involves the same selections in the wizard.

    You can chat with your users the ability to use a standard for these two columns prefix so that they will be treated as text. If you use "-" as a prefix data will display correctly.

  • There is a special token that I can put in a column of the CSV file recovery channel which implies approval of the current value?

    Versistand version is 2013 sp1.

    I use stimulus CSV expressions in my sequence in real time and want a channel to keep its value current (last) until a certain time. Is there a way to do this?

    Stimulation CSV file example:

    timestamp, chan1, chan2

    0,0,

    10, 1,

    20,1,5

    30,2,10

    In this example, chan2 would retain its current value until the timestamp 20.

    Is it possible to implement this feature?

    Kind regards

    Rick Howard

    Thank you! It is a valuable feedback. I can't think of a way to do natively with the functionality of reading CSV for sequences in real time. Some thoughts on how this can be done:

    1. create your own utility to sequences of script based on a CSV file in real-time. Extend the functionality of having a special marker in a cell which designates not only to change the value for the channel as timestep. Do not start from scratch. This tool open source and this one the two script of sequences in real time and stimulation of reading profiles based on data sets (although in different ways).

    2. with the help of software without insertion to the fault of the string value that you want to keep the initial value for the first X seconds of reading the CSV file. For example, you could play another sequence with your CSV file at fault the channel at its current value so that reading CSV does not replace the value.

  • How to create the .cod file to run on the Simulator BB9900

    Hi, I already from the zip package in order to use the bbwp command to create the .cod file and be able to run on the simulator of BB9900, but when I run this command as described in: https://developer.blackberry.com/html5/documentation/compile_ww_app_for_smartphones_1873321_11.html

    It creates two files, each with a .bar file, this type of file, I can't run it on the 9900 Simulator but a .cod file is required to run applications on the sim card.

    I don't know how to create the .cod file.

    Thank you

    Have you used Blackberry Webworks SDK for smartphone or Tablet SDK? The .cod files should be located in the subfolder OTAInstall of your output folder if you are using the Webworks SDK for Smartphone

Maybe you are looking for