How to solve extra commas in CSV files in FCC..!!

Hi,
I have the CSV file with comma(,) separator which has around 50 fields. Among them there were some description fields which has comma (ex: karan,kumar) which has to come as a single field and comes as 51 fields instead of 50.
Due to this, im facing problem at File content conversion and it is failing with error " ERROR converting document line no. 8534 according to structure 'Header':java.lang.Exception: ERROR in configuration / structure 'Header.': More elements in file csv structure than field names specified!
We have around 10 fields which comes in this way.Any idea how to solve this issue?
Thanks
Deepthi.

Hello Deepthi,
             The option here is use fieldFixedLengths instead of fieldSeparator. By this way evethough you have more fields in file than given filednames, it will not trigger any error. (But this one will still keep the commas which you might not need in the xml structure, though you can replace these in mapping anyway this is one solution )
enclosureSign option you can try, but you need do include the delimeter in you file structure, which is again a troublesum.
eg:- field1, | karan,kumar|,fieldn
In case you are familier with Adapter Module you can do it  easily, but its a final option as far i am concern.
Regards,
Prasanna

Similar Messages

  • How to load the data from .csv file to oracle table???

    Hi,
    I am using oracle 10g , plsql developer. Can anyone help me in how to load the data from .csv file to oracle table. The table is already created with the required columns. The .csv file is having about 10lakh records. Is it possible to load 10lakh records. can any one please tell me how to proceed.
    Thanks in advance

    981145 wrote:
    Can you tell more about sql * loader??? how to know that utility is available for me or not??? I am using oracle 10g database and plsql developer???SQL*Loader is part of the Oracle client. If you have a developer installation you should normally have it on your client.
    the command is
    sqlldrType it and see if you have it installed.
    Have a look also at the FAQ link posted by Marwin.
    There are plenty of examples also on the web.
    Regards.
    Al

  • How can we a validate a CSV file in SSIS and log the error details in another CSV File by using Sript Task.

    How can we a  validate a CSV file in SSIS and log the error details in another CSV File by using Sript Task.

    Please see:
    http://www.bidn.com/blogs/DevinKnight/ssis/76/does-file-exist-check-in-ssis
    http://social.msdn.microsoft.com/Forums/en-US/01ce7e4b-5a33-454b-8056-d48341da5eb2/vb-script-to-write-variables-to-text-file

  • How to handle a comma in a field in CSV file during FCC ?

    Hi,
    I am having a requirement where we have to convert a CSV file into XML using File Content Conversion . The issue is one of the field in the file is having a comma inside. So the XML parser is taking it as a field separator and throwing an error.
    The contents of the file are as follows:
    "02975859","New Key","9","Failed, rejected by RTI server"
    How to handle a comma inside field "Failed, rejected by RTI server".
    Any help would be appreciated.
    Regards
    Pravesh

    Hi ,
    You have to write an java mapping programm to perdromance this task , in a estandar way i think is not possible , because the fiel adapter have just one option for the delimiter character.
    Here's some code that could help you
    Supouse a file in this way:
    1,rahul,siemens,mumbai
    2,consultant,12032005
    1,viswanath,sisl,hyderabad
    2,systemeng,23052005
    package TXTMapping;
    import java.io.BufferedReader;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.io.OutputStream;
    import java.util.Map;
    import com.sap.aii.mapping.api.StreamTransformation;
    public class TMapping implements StreamTransformation {
    private Map map;
    public void setParameter (Map param){
    map = param;
    public void execute (InputStream in, OutputStream out){
    try{
    out.write("<?xml version ='1.0' encoding='UTF-8'?>".getBytes());
    out.write("<ns0:Output_Data xmlns:ns0=\"urn:javamapping_test\">".getBytes());
    String line = null;
    BufferedReader bin = new BufferedReader(new InputStreamReader(in));
    StringBuffer buffer = new StringBuffer();
    while((line = bin.readLine())!= null){
    String Company = null;
    String Name = null;
    String Place = null;
    String Desgn = null;
    String Since = null;
    char[] str= new char[100];
    str = line.toCharArray();
    String[] Data = new String[10];
    int S1 = 0;
    int s2 = 2;
    for (int i=2; i<line.length(); i++)
    if (str<i>==',' && str[0]=='1')
    Data[S1]= line.substring(s2,i);
    S1=S1+1;
    s2 = i+1;
    if (i == line.length()-1 && str[0] == '1')
    Data[S1]= line.substring(s2,i+1);
    Name = Data[0];
    Company = Data[1];
    Place = Data[2];
    out.write ("<Data>".getBytes());
    out.write ("<Header>".getBytes());
    out.write (("<Name>"Name"</Name>").getBytes());
    out.write (("<Company>"Company"</Company>").getBytes());
    out.write (("<Place>"Place"</Place>").getBytes());
    out.write ("</Header>".getBytes());
    if (str<i>==',' && str[0]=='2')
    Data[S1]= line.substring(s2,i);
    S1=S1+1;
    s2 = i+1;
    if (i == line.length()-1 && str[0] == '2')
    Data[S1]= line.substring(s2,i+1);
    Desgn = Data[0];
    Since = Data[1];
    out.write ("<Item>".getBytes());
    out.write (("<Designation>"Desgn"</Designation>").getBytes());
    out.write (("<Since>"Since"</Since>").getBytes());
    out.write ("</Item>".getBytes());
    out.write ("</Data>".getBytes());
    out.write("</ns0:Output_Data>".getBytes());
    catch(Throwable t){
    t.printStackTrace();

  • Ssrs 2012 export to comma delimited (csv) file problem

    In an ssrs 2012 report, I want to be able to export all the data to a csv (comma delimited) file that only contains the detailed row information. I do not want to export any rows that contain header data information.
    Right now the export contains header row information and detail row information. The header row information exists for the PDF exports.
    To have the header row not exist on CSV exports, I have tried the following options on the tablix with the header row information with no success:
    1. = iif(Mid(Globals!RenderFormat.Name,1,5)<>"EXCEL",false,true),
    2. = iif(Mid(Globals!RenderFormat.Name,1,3)="PDF",false,true),
    3. The textboxes that contain the column headers, the dataelelementoutput=auto and
       the text boxes that contain the actual data, I set the dataelelementoutput=output.
    Basically I need the tablix that contains the header information not to appear when the export is for a csv file.
    However when the export is for the detail lines for the csv export, I need that tablix to show up.
    Thus can you tell me and/or show me code on how to solve this problem?

    Hi wendy,
    Based on my research, the expression posted by Ione used to hide items only work well when render format is RPL or MHTML. Because only the two render format’s RenderFormat.IsInteractive is true.
    In your scenario, you want to hide tablix header only when export the report to csv format. While CSV file uses the textbox name in detail section as the column name, not the table header when you view the table. So if we want to hide the header row of the
    tablix, please refer to the steps below to enable the “NoHeader” setting in the RSReportserver.config file:
    Please navigate to RSReportserver.config file: <drive:>\Program Files\Microsoft SQL Server\MSRS1111.MSSQLSERVER\Reporting Services\ReportServer \RSReportserver.config.
    Backup the RSReportserver.config file before we modify it, open the RSReportserver.config file with Notepad format.
    In the <Render> section, add the new code for the CSV extension like this:
        < Extension Name="CSV"   Type="Microsoft.ReportingServices.Rendering.DataRenderer.CsvReport,Microsoft.ReportingServices.DataRendering">
            <Configuration>
                <DeviceInfo>
                   <NoHeader>True</NoHeader>
                </DeviceInfo>
            </Configuration>
        < /Extension>
    Save the RSReportserver.config file.
    For more information about CSV Device Information Settings, please see:
    http://msdn.microsoft.com/en-us/library/ms155365(v=sql.110)
    If you have any other questions, please feel free to ask.
    Thanks,
    Katherine xiong
    If you have any feedback on our support, please click
    here.
    Katherine Xiong
    TechNet Community Support

  • How to handle ' " '(double quotes) in .csv file during migration

    I am facing problem in migrating data from sql server 2000 into oracle via .csv file using sql loader.
    1>How should i migrate the string which contains ' " ' (double quotes) characters,
    as i am enclosing the string in ' " ' in .ctl file (enclosed by ' " ').
    is there any syntax in the control file which can migrate the ' " '(double quotes) as it is as the data in the files is 50000 records .?
    Thank you..

    Yes this is correct.
    but problem will occur when e.g check the foll. string.
    (1001,And I quote "This, will work")
    Here it is a comm(,) in b/w "This and will".
    due to this sqlldr interpret it as end of field. and throws an error.
    I had gone through expert one on one oracle, what it maintioned as,
    put an extra double quotes( " ) like " " to enclosed the double quoted string.
    This works fine. For small data it can be done manually.
    But for large data what condition can be put in the ctl file to achieve this?
    or is there any other way to achieve this?
    Thank you.

  • How can I make an easy *.CSV file to load into database table

    Hi All,
    I have a huge excel sheet having columns item#, description and qty. The description column sometimes maybe one word name, two word name separated with space or may be , spearated name. I want to write and PL/SQl code which will read this file and load it into database table. Now the *.CSV file is either comma delimited or tab text delmited which both do not solve my issue. Is there any better solution with anyone which can prevent the manual editing to the *.CSV file and I can easily load it to table.
    Your help is appreciated,
    Thanks
    Zahir

    SQL*Loader is probably the fastest method, but since you specifically asked for a PL/SQL method:
    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:464420312302

  • How to create a header in csv file

    I´m still newbie in Labview, I just learnt it this week..
    I want to make a data translation for temperature sensor..
    I´m having trouble to create a header in csv file,can anybody help me ?
    I also attach my csv file, what I wanted to make is like this :
    dt ( ms )
    channel 0
    channel 1
    channel 2
    0,1
    1
    2
    3
    0,2
    4
    5
    6
    0,3
    7
    8
    9
    0,4
    10
    11
    12
     I also want to know how to make the time count from 0 not from the real time..
    Solved!
    Go to Solution.
    Attachments:
    my block diagram.jpg ‏266 KB
    my csv file.jpg ‏508 KB

    I already solve the problem, It´s quite confusing, I must use ; instead of \t at the delimiter.
    I have another question to ask :
    - When I start the program,can I make the dt(ms) count from 0 ? What I can do is using the Format/Date time string, I don´t want the time count based on the real time.
    This is what I made
    dt(ms)
    Ch0
    10:04:2012  13:12:06,871
    24,139404
    10:04:2012   13:12:08,924
    23,773193
    10:04:2012   13:12:08,925
    23,132324
    10:04:2012   13:12:08,926
    22,918701
    What I want is like this :
    dt(ms)
    Ch0
    0
    24,139404
    0,01
    23,773193
    0,02
    23,132324
    0,03
    22,918701
    Thx for the helps..
    Regards
    Citras
    Attachments:
    test_temp.vi ‏25 KB

  • How to save excel report as CSV file with ActiveX

    Hi,
    I'm trying to save my excel test report as a CSV file using ActiveX and I'm having difficulty getting started.  I can't find an invoke node method that enables CSV file conversion. 
    Can anyone shed light on this?  See attached screenshot.
    Thanks
     

    As long as you are using the Report Generation Toolkit, there is no need to use ActiveX for the purpose of saving the Excel file -- Save Report will do that for you.  You can then export (as text) all of the Excel data and use the Write Spreadsheet File to make the .CSV file.  Here is how I would rewrite the final bits of your code --
    I cleaned up the wires around Excel Easy Table a bit.  You'll see I made a VI Icon for Replace Filename, which does (I think) a nicer job of self-documenting than showing its Label.  To make the filename, add the correct extension (.xlsx for Excel, .csv for CSV), use Build Path to combine Folder and Filename, and wire to Save Report.
    The next two functions add the Extract Everything and Write to Spreadsheet, using a Comma as a separator, which makes a CSV copy for you.
    Bob Schor

  • Commas in csv file

    I have csv file which look like this
    Name1,12,Address,"10,121.00",zip1
    Name2,13,Address,"11,150.00",zip2
    But the problem here is when xi reads it using file adapter the
    amount field is taken as two parts even if i have mentioned in quotes
    "10,121.00" - xi reads as "10 and 121.00"
    How can i handle commas of an amount field in a csv file
    Thanks
    Sebin

    Hi Sebin !
    Have you tried:
    (http://help.sap.com/saphelp_nw04/helpdata/en/e3/94007075cae04f930cc4c034e411e1/frameset.htm)
    &#9679;      NameA.enclosureSign
    Specify a string that acts as a text delimiter.
    Text enclosed by such delimiters is transferred to the target structure unchanged, although the default setting is to remove all text delimiters. Separators within such texts are ignored.
    This parameter is optional. The default setting is an empty value (no text delimiter).
    &#9679;      NameA.enclosureSignEnd
    If the text delimiters for the beginning and end of the text are different, specify the text delimiter for the end of the text here.
    If you do not make an entry here, the entry from NameA.enclosureSign is used.
    &#9679;      NameA.enclosureSignEscape
    Specify a string that replaces the text delimiter if it occurs within a text that it delimits.
    When the text is transferred the string is replaced by the value specified in NameA.enclosureSign .
    &#9679;      NameA.enclosureSignEndEscape
    Specify a string that replaces the text delimiter for the end of the text if it occurs within a text that it delimits.
    When the text is transferred the string is replaced by the value specified in NameA.enclosureSignEnd.
    &#9679;      NameA.enclosureConversion
    To remove the delimiter upon transfer, or to replace it with escape characters, enter YES. This is the default value.
    To transfer the characters unchanged enter NO.
    Note
    If you specify xml.enclosureSign=“ and xml.enclosureSignEsc=““, text enclosed in quotation marks is transferred unchanged and the quotation marks are removed.
    If the escape character for a quotation mark (““) occurs in the text itself, it is replaced by the quotation mark during the transfer.
    Regards,
    Matias.

  • How to save and open Text/csv file over APS

    Hi,
    I want to save(and open later) data from database block in text/csv file format over Application server, I did a lot of search here on Forms but didn't found a reasonable solution, Some one plz help me.
    Thanks and Regards, Khawar.

    As long as you are using the Report Generation Toolkit, there is no need to use ActiveX for the purpose of saving the Excel file -- Save Report will do that for you.  You can then export (as text) all of the Excel data and use the Write Spreadsheet File to make the .CSV file.  Here is how I would rewrite the final bits of your code --
    I cleaned up the wires around Excel Easy Table a bit.  You'll see I made a VI Icon for Replace Filename, which does (I think) a nicer job of self-documenting than showing its Label.  To make the filename, add the correct extension (.xlsx for Excel, .csv for CSV), use Build Path to combine Folder and Filename, and wire to Save Report.
    The next two functions add the Extract Everything and Write to Spreadsheet, using a Comma as a separator, which makes a CSV copy for you.
    Bob Schor

  • How do I prevent Save as .csv file alwways appending .txt to the filename if I choose the "Open with" action?

    My ASP csv download page is calling:
    Response.Clear
    Response.AddHeader "content-disposition","attachment; filename=filename.csv"
    Response.ContentType = "Content-Type: text/csv; charset=utf-8"
    When I click on the link to this ASP page the Firefox "Opening filename.csv" dialog appears:
    filename.csv
    which is a: Text Document
    If I choose "Open with <Any Application name>" the file is always opened by the application with a .txt appended to the filename, which in this particular case prevents my spreadsheet software from correctly opening it.
    a) How do I prevent the .txt being appended to the file name if OpenWith is used?
    b) Is there a way to add a CSV type to the Tools->Options Applications Content Type list to prevent the "which is a: Text Document" message?
    This behaviour does not happen in Chrome, Opera, Safari or IE.

    Is there no entry in Application Options for text/csv?
    orange Firefox button ''or'' classic Tools menu > Options > Applications
    In the search box, type csv and pause while Firefox filters the list.
    If you have Microsoft Office installed, the dialog typically lists "Microsoft Office Excel Comma Separated Values File (text/csv)" (you need to display the mouseover tooltip to see all of it).
    I assume Firefox extracts this information from the registry. If you want to reset the Application Options and have Firefox rebuild them, the method is described in this article:
    https://support.mozilla.org/en-US/kb/cant-download-or-save-files#w_reset-download-actions-for-all-file-types ("Reset download actions for all file types")

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

  • How to remove quotations marks  from csv file

    Hi
    My input file is a .csv file which contains each value in quotation marks
    ex: - "123456778","jakob","grade10"
    Also each record in the input file contains 333 values .
    i am reading these records and using stringtokenizer to fetch value by value for that record .
    i want to remove the quotation marks before i put the values back into an output file with .txt extension .
    those output files will be bcped later into sybase db.
    Should the quotation marks be removed in the java code or is their anyother way to remove the quotation marks from the output file while bcping them .
    Thank You

    njb7ty wrote:
    I also suggest if possible, you use tab delimited cvs files rather than comma delimited cvs files.That would be TSV, LOL...
    If there are commas inside your data elements, you will not be able to tell if they are part of the data or are delimiters. Tab delimited files avoid this.What if your data contain tabs? Although there's no CSV specification, the common standard practice is to use two double quotes to escape a quote.

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

Maybe you are looking for

  • ICal - recurring "server responded with an error" message

    After years of using iCal without problems, (except for some recent duplicate alarms), a recurring error message has suddenly started popping up. It says: "The server responded with an error. Access to account "***@me.com" is not permitted. The serve

  • Order of all day events • printing list view without empty days

    I have only just started to use iCal in a work context. I need to programme over 500 events in several different locations (probably up to 10 locations on one day). I have divided these locations into five regions, and have made a calendar for each r

  • Planning file entries missing for some materials in MD21.

    Hi gurus, when i check the MD21, i found that some materails are not having planning file entries i.e netch and netpl indicator .and because of this we found that these materials are not being in planning. From my understanding these planning file en

  • I want to install yosemite via external hd but my internal hd is not showing in the utilise disk

    please help i think I'm stuck Have been trying every way i know and found on internet to install os x yosemite on my macbook pro 2.4GHz the final method i tried is to install via external hd since my new hdd don't have recovery on it i boot in succes

  • Abap Query - Delete duplicates

    I I'm doing an abap query in SQ02 with LIKP and LIPS tables. As output I just want lines with different entries in LIPS of material. How can I delete the duplicates? With instruction delete ADJACENT DUPLICATES FROM XXXX COMPARING vbeln matnr, how can