<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Extra Comma in CSV in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/extra-comma-in-csv/m-p/7388668#M1545083</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Text fields always have such a problem. It will be good to use a tab delimited file or use the diffenet separator as suggested above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nabheet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 Oct 2010 03:26:27 GMT</pubDate>
    <dc:creator>nabheetscn</dc:creator>
    <dc:date>2010-10-21T03:26:27Z</dc:date>
    <item>
      <title>Extra Comma in CSV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/extra-comma-in-csv/m-p/7388664#M1545079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am reading the data from CSV File.&lt;/P&gt;&lt;P&gt;One of the field is description and the description has a comma within.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My internal table is not populated properly coz of this.&lt;/P&gt;&lt;P&gt;I am splitting the raw data at ','.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg: description = Herald Group Activity,Quarter 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is entire description but the comma before Quarter is a part of description and not the delimeter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any work around??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Oct 2010 02:48:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/extra-comma-in-csv/m-p/7388664#M1545079</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-21T02:48:21Z</dc:date>
    </item>
    <item>
      <title>Re: Extra Comma in CSV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/extra-comma-in-csv/m-p/7388665#M1545080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The workaround would be to not use a simple csv format.&lt;/P&gt;&lt;P&gt;You can either try using some rare symbols such as | or ~&lt;/P&gt;&lt;P&gt;Alternatively, you can use two commas ie: ,, as the separator.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Oct 2010 02:58:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/extra-comma-in-csv/m-p/7388665#M1545080</guid>
      <dc:creator>former_member189059</dc:creator>
      <dc:date>2010-10-21T02:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: Extra Comma in CSV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/extra-comma-in-csv/m-p/7388666#M1545081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately, the file is coming from some legacy.&lt;/P&gt;&lt;P&gt;If the delimeter is to be changed, it will be a long process.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Pranu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Oct 2010 03:00:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/extra-comma-in-csv/m-p/7388666#M1545081</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-21T03:00:51Z</dc:date>
    </item>
    <item>
      <title>Re: Extra Comma in CSV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/extra-comma-in-csv/m-p/7388667#M1545082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pranu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are using a Description in the file then it is very difficult to handle in the .CSV file.&lt;/P&gt;&lt;P&gt;If your data contains , then the best workaround  is to use a TAB delimited file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Immanuel.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Oct 2010 03:13:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/extra-comma-in-csv/m-p/7388667#M1545082</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-21T03:13:31Z</dc:date>
    </item>
    <item>
      <title>Re: Extra Comma in CSV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/extra-comma-in-csv/m-p/7388668#M1545083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Text fields always have such a problem. It will be good to use a tab delimited file or use the diffenet separator as suggested above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nabheet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Oct 2010 03:26:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/extra-comma-in-csv/m-p/7388668#M1545083</guid>
      <dc:creator>nabheetscn</dc:creator>
      <dc:date>2010-10-21T03:26:27Z</dc:date>
    </item>
    <item>
      <title>Re: Extra Comma in CSV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/extra-comma-in-csv/m-p/7388669#M1545084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Pranu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; I assume you are reading the .CSV into an internal table, looping at it and splitting each record at comma. You may also want to consider reading fields by their length in this scenario. For example.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
wa_processed-field1 = wa_raw(10).
wa_processed-field2 = wa_raw+10(5).
wa_processed-field3 = wa_raw+15(3).
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Probably not the cleanest method. But in this scenario, we dont have a lot of options available.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jinesh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Oct 2010 03:33:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/extra-comma-in-csv/m-p/7388669#M1545084</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-21T03:33:27Z</dc:date>
    </item>
    <item>
      <title>Re: Extra Comma in CSV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/extra-comma-in-csv/m-p/7388670#M1545085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In ideal case if all the fields are present in the file, it could be used.&lt;/P&gt;&lt;P&gt;But my file is having 204 fields and not always all fields are filled.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess changing the delimeter will be the right option but the only problem is it will have to go through long process and approvals &lt;SPAN __jive_emoticon_name="sad"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pranu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Oct 2010 03:38:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/extra-comma-in-csv/m-p/7388670#M1545085</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-21T03:38:07Z</dc:date>
    </item>
    <item>
      <title>Re: Extra Comma in CSV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/extra-comma-in-csv/m-p/7388671#M1545086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pranu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You tell the Legacy file creation system to put ' " ' at the begining and at the end of the value which contains comma. Then consider the ' " ' at the time of spliting. You will get lots of code in the net for this kind of spliting. In MS Excel also do the same thing when it is creating the .csv file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amitava&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Oct 2010 03:46:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/extra-comma-in-csv/m-p/7388671#M1545086</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-21T03:46:02Z</dc:date>
    </item>
    <item>
      <title>Re: Extra Comma in CSV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/extra-comma-in-csv/m-p/7388672#M1545087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Pranu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the , as content shall be escaped by quotation marks. I have contributed  a [sample|http://wiki.sdn.sap.com/wiki/display/Snippets/Convert&lt;EM&gt;Internal&lt;/EM&gt;Table&lt;EM&gt;to&lt;/EM&gt;CSV&lt;EM&gt;Spreadsheet&lt;/EM&gt;format&lt;EM&gt;%286.40&lt;/EM&gt;and+higher%29] in the code gallery recently. Possibly you can use the sample as it is or derive your custom solution from it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Klaus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Nov 2010 18:38:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/extra-comma-in-csv/m-p/7388672#M1545087</guid>
      <dc:creator>former_member183804</dc:creator>
      <dc:date>2010-11-26T18:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: Extra Comma in CSV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/extra-comma-in-csv/m-p/7388673#M1545088</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Below FM resolved the issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

 CALL FUNCTION 'KCD_EXCEL_OLE_TO_INT_CONVERT'
    EXPORTING
      filename                = v_filename
      i_begin_col             = 1
      i_begin_row             = 2
      i_end_col               = 256
      i_end_row               = 9999
    TABLES
      intern                  = ta_kcde_cells
    EXCEPTIONS
      inconsistent_parameters = 1
      upload_ole              = 2
      OTHERS                  = 3.
  IF sy-subrc &amp;lt;&amp;gt; 0.
    MESSAGE e079(z1) WITH 'Error opening file'.
  ENDIF.

  CHECK NOT ta_kcde_cells[] IS INITIAL.
  SORT ta_kcde_cells BY row col.
*** Collect data from the excel file
  LOOP AT ta_kcde_cells.
    MOVE : ta_kcde_cells-col TO da_index.

    IF da_index &amp;lt; 205.
      ASSIGN COMPONENT da_index OF STRUCTURE wa_file TO &amp;lt;fs&amp;gt;.
      MOVE : ta_kcde_cells-value TO &amp;lt;fs&amp;gt;.
      IF da_index = 1 OR da_index = 8.
        TRANSLATE &amp;lt;fs&amp;gt; TO UPPER CASE.
      ENDIF.
    ENDIF.

    AT END OF row.
      IF wa_file IS INITIAL.
        EXIT.
      ENDIF.
      APPEND wa_file to i_file.
      CLEAR wa_file.
    ENDAT.
  ENDLOOP.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Nov 2010 19:15:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/extra-comma-in-csv/m-p/7388673#M1545088</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-30T19:15:52Z</dc:date>
    </item>
  </channel>
</rss>

