CSV file column heading

Hi Experts,
This is File to IDOC scenario. The source file is a csv file with header and item records.
The file comes with column headings and now problem is how to remove the column headings using my content conversion.
Any help would be appericiated
Regards,
Vijay

Hi Prakash,
Yes you are right but now my problem is the file will not have the header all the time. Actually the source files are generated from different legacy systems so some may have column headings and some may not have.. but the structure remains the same.
Regards,
Vijay
Message was edited by: Vijay Kuruvila
Message was edited by: Vijay Kuruvila

Similar Messages

  • Data set created out of csv file: columns not recognized, too many rows

    After uploading a csv file I got out of the OPP the columns don't get recognized in the dataset viewer. Perhaps this happens because the delimiter is a semicolon instead of a comma? Unfortunately, I have no influence how the data gets exported out of the OPP. Is there any option to configure which delimiter to recognize, like it's possible in excel?
    Further, is it possible to configure from which row on the data should be taken into account, similar to excel? With the csv file I get out of the OPP, the data only starts with row 7, while row 6 has the headings.

    After uploading a csv file I got out of the OPP the columns don't get recognized in the dataset viewer. Perhaps this happens because the delimiter is a semicolon instead of a comma? Unfortunately, I have no influence how the data gets exported out of the OPP. Is there any option to configure which delimiter to recognize, like it's possible in excel?
    The delimiter cannot be configured. Comma is the delimiter. I would suggest that you open this file in text editor then replace semicolon with comma. After that you can reupload your dataset.
    Further, is it possible to configure from which row on the data should be taken into account, similar to excel? With the csv file I get out of the OPP, the data only starts with row 7, while row 6 has the headings.
    This is not configurable as well.

  • Trying to omit first line of CSV file (the header)

    Hello everybody,
    Newbie here havin a lil problem. I have this program below that reads in a CSV file. My test CSV file has the follow structure:
    ID, LastName, FirstName, Phone, Email,
    2345, Yez, Wei do, 456-789-0123, [email protected],
    2744, Avanto, Aldo, 562-593-6500, [email protected],
    1212, Dewy, Cheatem, 123-456-7890, [email protected],
    1234, No, Wei Foo, 123-456-7890, [email protected],
    The first line is my header. (here is the heart of my problem)
    I have the program reading in the file and the it sorts it. The problem i have is that the first line, my header gets sorted with everything else. Here is my feable attempt with resulting error:
    import java.io.*;
    import java.util.*;
    public class File2Array {
        public static void main(String[] args)
            File file = new File("person_test1.csv"); //File to read in
            ArrayList persons = (ArrayList) getPersons(file); //call to arraylist
            Collections.sort(persons);
            for (Iterator i = persons.iterator(); i.hasNext(); )
                System.out.println(i.next());
        public static List getPersons(File file)
    //NEW PIECE OF CODE        boolean first = true;
            ArrayList persons = new ArrayList();
            try {
                BufferedReader buf = new BufferedReader(new FileReader(file));
                while (buf.ready()) {
                    String line = buf.readLine();
    //NEW PIECE OF CODE
         while( ( line = buf.readLine() ) != null )
              if( first )
                   first = false;    continue;
    //ORIGINAL IF
         //   if (!line.equals("") )
    //NEW IF
                    if (line != null && !line.equals("") )
    //END OF NEW CODE
                         StringTokenizer tk = new StringTokenizer(line, ",");
                         ArrayList params = new ArrayList();
                         while (tk.hasMoreElements())
                             params.add(tk.nextToken());
                         Person p = new Person(
                                 (String) params.get(0),
                                 (String) params.get(1),
                                 (String) params.get(2),
                                 (String) params.get(3),
                                 (String) params.get(4));
                         persons.add(p);
            } catch (IOException ioe)
                System.err.println(ioe);
            return persons;
    class Person implements Comparable
        private String ID;
        private String LastName;
        private String FirstName;
        private String Phone;
        private String Email;
        public Person(
            String ID,
            String LastName,
            String FirstName,
            String Phone,
            String Email)
            if (FirstName==null || LastName==null)
                throw new NullPointerException();
            this.ID = ID;
            this.LastName = LastName;
            this.FirstName = FirstName;
            this.Phone = Phone;
            this.Email = Email;
        public String toString()
            StringBuffer sb = new StringBuffer ();
            sb.append( ID );
            sb.append(" ");
            sb.append( LastName );
            sb.append(" ");
            sb.append( FirstName );
            sb.append(" ");
            sb.append( Phone );
            sb.append(" ");
            sb.append( Email );
            sb.append(" ");
            return sb.toString();
        public boolean equals(Object o)
            if (!(o instanceof Person))
                return false;
            Person p = (Person)o;
            return p.FirstName.equals(FirstName) &&
                   p.LastName.equals(LastName);
        public int hashCode()
            return 31*FirstName.hashCode() + LastName.hashCode();
        public int compareTo(Object o)
            Person p = (Person)o;
            int lastCmp = LastName.compareTo(p.LastName);
            return (lastCmp!=0 ? lastCmp :
                    FirstName.compareTo(p.FirstName));
    this code compiles and runs but does not produce any output and I don't understand why.
    Question: What is the proper way to have the code omit the first line of a CSV file??
    By the way I do have another file called person.java that goes with this but I didn't think I had to post it.
    Also am I posting correctly? Am I putting in too much code??
    Than you!!

    Hot diggity! jverd,
    I got it to work!! here's what I did all thanks to you :-)
    ArrayList persons = new ArrayList();
            try {
                BufferedReader buf = new BufferedReader(new FileReader(file));
                //read through file and populate array
                //while (buf.ready()) {
                    String firstline = buf.readLine();  //gets header, renamed line to firstline
                    String line;                  //added this line     
                    System.out.println(firstline);     //added this to print out firstline     
         //try this
              while( ( line = buf.readLine() ) != null )
              /*{                    //commented out this portion
              if( first )
                   first = false;    continue;
              //end try this                
                    //if (line != null && !line.equals("") )     //down to here
                    if (!line.equals("") )          //added this
                         StringTokenizer tk = new StringTokenizer(line, ",");
                         ArrayList params = new ArrayList();
                         while (tk.hasMoreElements())
                             params.add(tk.nextToken());
                         Person p = new Person(
                                 (String) params.get(0),
                                 (String) params.get(1),
                                 (String) params.get(2),
                                 (String) params.get(3),
                                 (String) params.get(4));
                         persons.add(p);
                      }                       

  • How to delete contents of a csv file except header using powershell

    Hi,
    I am trying to delete all the content of my csv file except its header. currently I am using clear-content but using this headers are also getting deleted. Basically I need a command which deletes all the rows of a csv file except first row.Please help.

    I'm only going to respond to prove that the useless troll is useless and wrong.
    Perhaps someday the troll will finally realize that it is worthless and will go away. No one cares about what it has to say and no one has ever found it to be helpful. Even good information is bad information when it is presented in an insulting, blathering,
    incoherent, and belittling tone. Plus, I think it's really funny when something tries to justify its own sad existence by making itself feel superior (when it clearly isn't). Sometimes I almost feel bad for it, but then it reminds me of how big of a jerk it
    really is.
    Get a life, get some friends, just go do something that isn't totally worthless (yeah, I know, you can't..).
    Don't retire TechNet! -
    (Don't give up yet - 12,700+ strong and growing)

  • Import CSV file: column count mismatch by always 1

    Hello,
    I am trying to import data from a CSV file into a HANA db table with an .hdbti file.
    I have a large structure of 332 fields in the table. When I activate the files to start the import, I always get the following message:
    CSV table column count mismatch. The CSV-file: Test.data:data.csv does not match to target table: Test.data::test. The number of columns (333) in csv record 1 is higher than the number of columns (332) in the table.
    But even if I delete the last column in the CSV file, the message stays the same. I also tried adding an additional field in the table on HANA, but then the column numbers in the error message just increase by 1. Then the message is: The number of columns (334) in csv record 1 is higher than the number of columns (333) in the table.
    So, it seems, whatever I do, the system thinks always that the csv file has one column too much.
    With another smaller structure of 5 fields, the import worked that way.
    Do you have an idea what the problem could be?
    Regards,
    Michael

    Hi Michael,
    It may be coz of delimiter problem or something. Can you paste the control file content here. So that i can check it out. Issue may be in your control file.
    Also if you can show the contents of the your *.err error log file, we can have a broader picture.
    Regards,
    Safiyu

  • Script to merge multiple CSV files together with no duplicate records.

    I like a Script to merge multiple CSV files together with no duplicate records.
    None of the files have any headers and column A got a unique ID. What would be the best way to accomplish that?

    OK here is my answer :
    2 files in a directory with no headers.
    first column is the unique ID, second colomun you put whatever u want
    The headers are added when using the import-csv cmdlet
    first file contains :
    1;a
    2;SAMEID-FIRSTFILE
    3;c
    4;d
    5;e
    second file contains :
    6;a
    2;SAMEID-SECONDFILE
    7;c
    8;d
    9;e
    the second file contains the line : 2;b wich is the same in the first file
    the code :
    $i = 0
    Foreach($file in (get-childitem d:\yourpath)){
    if($i -eq 0){
    $ref = import-csv $file.fullname -Header id,value -Delimiter ";"
    }else{
    $temp = import-csv $file.fullname -Header id,value -Delimiter ";"
    foreach($line in $temp){
    if(!($ref.id.contains($line.id))){
    $objet = new-object Psobject
    Add-Member -InputObject $objet -MemberType NoteProperty -Name id -value $line.id
    Add-Member -InputObject $objet -MemberType NoteProperty -Name value -value $line.value
    $ref += $objet
    $i++
    $ref
    $ref should return:
    id                                                         
    value
    1                                                          
    a
    2                                                          
    SAMEID-FIRSTFILE
    3                                                          
    c
    4                                                          
    d
    5                                                          
    e
    6                                                          
    a
    7                                                          
    c
    8                                                          
    d
    9                                                          
    e
    (get-childitem d:\yourpath) -> yourpath containing the 2 csv file

  • Interactive Report Download CSV file Issue (output includes separator BR)

    Hi,
    I have a Interactive Report and displaying the column values (multiple values in same ROW) as mentioned below.
    SQL Query
      select deptno,
           function1(empno) empno
      from emp
    IR Output
    Dept       Employee No
    10         AAA,BBB,CCC, ...    // -  Row 1
    20         XXX,YYY,ZZZ, ...    // -  Row 2 Now I want to display each employee in a new Line, so modified the SQL Query
    Modified SQL Query
      select deptno,
           REPLACE(function1(empno),',','<br>') empno
      from emp
    New IR Output
    Dept       Employee No
    10         AAA
               BBB
               CCC
               ...    // -  Row 1
    20         XXX
               YYY
               ZZZ
                ...    // -  Row 2 SO, Interactive Report Out put looks fine and that's the way we want.
    But the problem is when I download the Report in CSV or in PDF using the Action Menu -> Download..
    I am getting break line B R in the output, and also I have two different output in CSV for two different column. [Logic is same for both the columns.]
    CSV output1
    Employee No
      AAA<br>BBB<br>CCC
      XXX<br>YYY<br>ZZZI have other columns also with multiple values...for that column, I am getting the following CSV output
    CSV output2
    City List
      1111<br>
      2222<br>
      3333<br>So, in CSV for one column, I am getting all the values in same line with the seperator B R (Output1)
    for other column, I am getting values in new line with the separator B R. (Output2)
    Is there a way to FIX this CSV or PDF output for Interactive Report.
    I DON'T WANT THE SEPARATOR BR in CSV and also the values should always be in New Line.
    I want to have the following Output in CSV
    Employee No
      AAA
      BBB
      CCCThanks,
    Deepak
    Edited by: Deepak_J on Feb 24, 2010 11:45 AM
    Edited by: Deepak_J on Feb 24, 2010 11:46 AM
    Edited by: Deepak_J on Feb 24, 2010 11:48 AM

    Thanks.. Jari.. for the quick response.
    I updated my SQL query with Chr(10) and added the code in Page HTML header.
    Now the CSV & PDF output are fine..getting each individual value in seperate line (no BR tag)
    BUT in the Interactive Report Output, I am now getting first 2 values in 1 line, then next value in next line, and so on..
    IR Output
    Employee
      AAA BBB
      CCCCCCC
      DDDDDI have few more issues with CSV & PDF output
    1. In PDF is there a way to increase the column width, as for some of the columns, the values are getting truncated.
    2. For some of the columns in IR Report, I have user BR tag in Column Heading and this also come in CSV output (column heading with BR tag), is there a way to fix this. In PDF Column headings are fine (no BR tag)
    and by the way..what exactly this does.
    <style type="text/css">
    .apexir_WORKSHEET_DATA td{white-space:pre;word-wrap: break-word}
    </style>Thanks,
    Deepak
    Edited by: Deepak_J on Feb 24, 2010 12:20 PM
    Edited by: Deepak_J on Feb 24, 2010 12:21 PM

  • Export table to flat file and need to insert sysdate in flat file column

    Hi, I created an interface to export oracle table to a csv file. All of the table columns are working well. Then I need to insert the sysdate in csv file column.
    I made the mapping as working in staging area, implementation is to_char(sysdate,'dd/mm/yyyy'). But the result is insert 14 to the column.
    I have tried to create a variable refreshing as select to_char(sysdate,'dd/mm/yyyy') from dual, then mapping that to the column in csv file, but it only insert to 1 row and the format is yyyymmdd.
    I have tried to use  SELECT '<%=odiRef.getSysDate( "yyyyMMdd")%>' from dual for the variable, and it also only insert one row to the flat file.
    I used the same methodology in ODI10g, it works fine.
    So, I am wondering how it can be implemented in 11g.
    Thanks

    The first option you have stated seems like the obvious choice - I don't see any reason why this shouldn't work.  What do you mean by "But the result is insert 14 to the column." Do you mean that it inserted the string "14" (I can't imagine why this would be the case) or that it inserted 14 rows?

  • Comma and quote problem in csv file

    Hi
    My requirement is to append data in an csv file. This is Proxy to File FCC Scenario. for some of the fields from proxy which contains comma(,) and also double-quote("). for these fileds the in the csv file it is spiting in to two columns and appending in to the next column. and the double-quote symbol is not inserting in the csv file.
    1. why the double-quote(") is not inserting in to the csv file columns?
    2. how to over come the comma problem? I want that particular file need to append in one column only.
    Thanks
    Vankadoath

    hi vankadoath,
    Were you able to solve comma issue in CSV file.
    Even i am facing similar issue.....
    wheneever there is a comma in field, it is updating data after comma into next field.
    If anybody has solution for the same.......
    pls suggest the same............
    santosh.
    Edited by: santosh koraddi on Jan 20, 2011 9:44 PM

  • Column heading is not coming while generating a .csv file from .sql file

    Hi all,
    Now since I am able to generate a .csv file by executing my .sql file, the column heading is missing in that. Please advise. I have used the following parameters in my query:
    set linesize 1000
    set colsep ','
    set echo off
    set feedback off
    set pagesize 0
    set trimspool on
    spool /path/file.csv
    select ...... from .... where .....;
    spool off
    exit

    set pagesize 0 <-- your problem
    you must set it into a high value (max value 50000)
    see:
    SQL> select * from dual;
    D
    X
    SQL> set pagesize 0
    SQL> select * from dual;
    X
    SQL> set pagesize 50000
    SQL> select * from dual;
    D
    X

  • Add header record with column names while writing csv file fileAdapter?

    Hi I am writing the output of a query to csv file using fileadapter. but the file generated does not have the header record with the column names. how can I achieve this. please help.

    I'm trying to do the same, but something is not right with my syntax and I haven't been able to resolve all day. Can someone spot what I'm doing wrong?
    Here is the variable with the data I want to insert as the headers for the CSV:
    Updated variable "CPARWebJEHeaders"
    <CPARWebJEHeaders>
    <Root-Element xmlns="http://xmlns.oracle.com/CPWebJEARWrite">
    <CPARWebJE>
    <Project>Project</Project>
    <Organization>CC_Org</Organization>
    <Account>Account</Account>
    <TransactionAmount>Amount</TransactionAmount>
    <TransactionDesc>Description</TransactionDesc>
    </CPARWebJE>
    </Root-Element>
    </CPARWebJEHeaders>
    Here is the InputVariable data for my invoke to the File Adapter:
    [2008/03/24 15:27:30] Updated variable "WriteCPARWebJEFile_Write_InputVariable"
    <WriteCPARWebJEFile_Write_InputVariable>
    <part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Root-Element">
    <Root-Element xmlns="http://xmlns.oracle.com/CPWebJEARWrite">
    <ns0:CPARWebJE xmlns:ns0="http://xmlns.oracle.com/CPWebJEARWrite">
    <ns0:Project>INV08-00002</ns0:Project>
    <ns0:Organization>1.6.1.1.01</ns0:Organization>
    <ns0:Account />
    <ns0:TransactionAmount>176</ns0:TransactionAmount>
    <ns0:TransactionDesc />
    </ns0:CPARWebJE>
    <ns0:CPARWebJE xmlns:ns0="http://xmlns.oracle.com/CPWebJEARWrite">
    <ns0:Project>INV08-00001</ns0:Project>
    <ns0:Organization>1.6.1.1.01</ns0:Organization>
    <ns0:Account />
    <ns0:TransactionAmount>305.46</ns0:TransactionAmount>
    <ns0:TransactionDesc />
    </ns0:CPARWebJE>
    </Root-Element>
    </part>
    </WriteCPARWebJEFile_Write_InputVariable>
    This is my latest iteration of the insertBefore command, which is done right after the transformation populating the variable above:
    <bpelx:assign>
    <bpelx:insertBefore>
    <bpelx:from variable="CPARWebJEHeaders" query="/ns12:Root-Element/ns12:CPARWebJE"/>
    <bpelx:to variable="WriteCPARWebJEFile_Write_InputVariable" part="Root-Element"/>
    </bpelx:insertBefore>
    </bpelx:assign>
    And finally, here is the current error message:
    <selectionFailure xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/">
    <part name="summary">
    <summary>Assign Operation Misuse. The parent of the selection result does not exist or is not an XML element; insertBefore operation cannot be performed. Please check the BPEL source at line number "96" .</summary>
    </part>
    </selectionFailure>
    I understand the error message, but for the life of me can't get it resolved. Trying to change the "to" variable, I can't even get the process to deploy. FYI this is on 10.1.2 and I can't go to 10.1.3 yet, but I think this is a syntax issue and not related to the version.
    Thanks!
    Message was edited by:
    user623606

  • How to asssign output value in the CSV file for the specific header

    Hi,
    I am using OpenScript 9.10. The problem I am facing is that, to Write the Output value captured from the application, When i am trying to use the methods "Appen String to File" i am unable to write / assign the out put value below the specific header. Can any one please look into this and post the methods related to Write the output vaues in to the CSV files under specific headers.
    Thanks in Advance.
    Thanks.,
    Siva

    Hi Alex,
    Thanks for your reply.I need to write the output value under specified parameter name.
    for example after creating the sales order,the order number have to write in the CSV file under
    OrderNumber column.I tried with appendStringtofille() method,by using this able to write the value under
    first column.But i need to write output value under specified columnname(means Header name in the cSV
    file).can u please give a reply for the above problem.
    Note: In that Csv file i am taking the input vales and also need to write the output values under
    specified column(header)
    Thanks,
    Siva Thota.

  • Supress Column Heading - File Content Conversion in Sender Adapter

    Hi,
    Let me give a more clear picture about my scenario.  I need to convert CSV File to XML output:-
    My source file has column heading and values.  The sample data is mentioned hereunder:-
    PERNR;KID;PNALT;NACHN;NAME2;VORNA
    ;1200;1200;Angus
    I have created a data type as under:-
    DT_LegacyEmployee (Category - Complex Type)
         Employees (Category - Element, Occurence - 1)
              Header (Category - Element, Occurence - 0...1)
                   PERNR_H
                   KID_H
                   PNALT_H
                   NACHN_H
                   NAME2_H
                   VORNA_H
              Employee (Categroy - Element, Type - DT_LegacyEmployee_Row, Occurence - 0...unbounded)
                   PERNR
                   KID
                   PNALT
                   NACHN
                   NAME2
                   VORNA
    The file conversion parameters in the file sender adapter are mentioned hereunder:-
    Document Name - MT_LegacyEmployee
    Document Namespace - http://abc.com/xi
    Recordset Name - Employees
    Rescordset Structure - Header,1,Employee,*
    Recordsets per Message - 1
    Key Field Type - String (Case Sensitive)
    Employee.fieldSeparator - ;
    Employee.endSeparator - 'nl'
    Employee.fieldNames - PERNR,KID,PNALT,NACHN,NAME2,VORNA
    I dont' have a key field value.  How do we remove the header and show only the values in the xml output.  I have searched the forum topics as well checked many blogs related to file content conversion, but nothing helped.  Kindly advice how to fix this issue.  Thanks in advance.
    Regards.
    Praveen

    Hi Praveen,
    Change your File Adapter as below
    Document Name - MT_LegacyEmployee
    Document Namespace - http://abc.com/xi
    Recordset Name - Employees
    Rescordset Structure - Employee,*
    Recordsets per Message - 1
    Key Field Type - String (Case Sensitive)
    Employee.fieldSeparator - ;
    Employee.endSeparator - 'nl'
    Employee.fieldNames - PERNR,KID,PNALT,NACHN,NAME2,VORNA
    There is no need for the Header required in the data type.
    DT_LegacyEmployee (Category - Complex Type)
    Employees (Category - Element, Occurence - 1)
    Employee (Categroy - Element, Type - DT_LegacyEmployee_Row, Occurence - 0...unbounded)
    PERNR
    KID
    PNALT
    NACHN
    NAME2
    VORNA
    Now the trick is in the mapping program
    Lets assume your mapping looks like
    MT_LegacyEmployee ---> MT_TargetEmployee
    - Employees ---> Records
       - Employee ---> Record
         - PERNR  ---> TargetPERNR
         - .. so on
    When you do a mapping from Employee ---> Record apply the following logic.
    (PERNR)--->
                 (TestEquals =) --->(NOT)--->
    (Constant) --->                                (IF)
    (PERNR)                       (IF Without Else) ---> (Record)
                                                   (THEN)
                                (Employee)--->
    When doing this make sure RightClick on PERNR and Select Context ---> Employees.
    By default context would be from Employee and it will give you an error of XSD format. So make sure you are changing the context.

  • Creating a header for a .CSV file

    Hi,
    I have looked through the forums and cannot find a solution for creating a header for a csv file.  I am using Labview 8.2.  I want a label for each column at the top of the file and then I will append new rows to the file as the data is collected.  An example of what I am looking for is attached.
    It would also be nice to have the labels descending in the first column, pretty much a transposed version of what was described above. 
    Thanks,
    Gary 
    Solved!
    Go to Solution.
    Attachments:
    exampleLOG.csv ‏1 KB

    Thank you very much.  That worked well. 
    If i wanted to transpose the data how would I do that?  I can get the header to be vertical, but I cant get the data to append to the 2nd column , and then the third and so on with the data descending from top to bottom.  I attached an example of what I might want the file to look like. Each column would be added one at a time.
    Attachments:
    data3.csv ‏1 KB

  • Combine multiple CSV files into a single multi-column CSV file

    Hey Scripting Guy!
    I have what is probably a simple issue, but I haven't been able to find the right answer.
    I have 18 CSV files that each contain the same header and a single value as shown below:
    "Sum"
    "90"
    These files are the results of SMTP traffic by domain.
    All I want to do is to combine the 18 CSV files into a single file with the content of each file in a separate column, using the file name as the column header.
    For example:
    file1.csv
      "Sum"
      "90"
    file2.csv
      "Sum"
      "325"
    file2.csv
      "Sum"
      "3534"
    The desired ouput is:
    "file1.csv","file2.csv","file3.csv"
    "Sum","Sum","Sum"
    "90","325","3534"
    I don't need to row of Sum's if it is easy to leave out.  It would be even better if this could be put into an Excel spreadsheet.
    Thanks for your help!

    Can you post your script?
    If you are not a technician and do not want to write a script then you should try hiring a consultant.
    If you want to learn how to write a script then start here:
    http://technet.microsoft.com/en-us/scriptcenter/dd793612.aspx
    By the way...your request makes no logical or technical sense.  What is the point of doing this?  There is no relationship between these files.
    ¯\_(ツ)_/¯

Maybe you are looking for