Skip to Content
avatar image
Former Member

Double quotes handling in file content conversion

Hi ,

I am reading txt file using FCC

example:

"OP01","B","3230","400201","00520550220I","N32305IT2158","2017-03-09 00:00:00","2017-03-10 00:00:00","943 945 954 ","R15A310001","G(DX)+, TC(2V)+","","","","500,958","","","","","","","","0730"

I wanted to remove first double quotes " only . I have field separator ","

so can not remove double quotes " from rest of the part in string by using enclosureSignEsc parameter

Regards

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Mar 15, 2017 at 08:33 PM

    Hi Abhay,

    Why wouldn't you simply use a field separator of . and an enclosureSign of " ?? Setting up the FCC with those parameters would remove all . characters except those within the field content and then strip all " from the data unless you specify otherwise.

    Regards,

    Ryan Crosby

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 16, 2017 at 03:36 AM

    Hi Ryan,

    My field separator is "," so cannot use , as separator it will mix all the column values if I will remove an enclosureSign of " ??

    Regards,

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 16, 2017 at 06:18 AM

    Hi Abhay,

    Check the below link

    https://archive.sap.com/discussions/thread/1725047

    Regards,

    Manoj Kumar

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 16, 2017 at 08:44 AM

    Hi Abhay,

    Are your OS a Linux?, you can use a OS system command "sed" to remove the first double quotes. This link explains an example, not equals than yours, but similar http://stackoverflow.com/questions/9733338/shell-script-remove-first-and-last-quote-from-a-variable

    Another option would be to use the point as separator and skip the double quotes at mapping level.

    Regards.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 16, 2017 at 04:43 PM

    Hi Inaki,

    We have PI server on AIX OS will this script work on AIX .

    for 2nd option I cannot use point as separator as "," is coming in file from source as separator

    Hi Manoj,

    I tried to use begin field separator but it didn't worked

    Regards

    Add comment
    10|10000 characters needed characters exceeded