Skip to Content
0

Double quotes handling in file content conversion

Mar 15, 2017 at 04:47 PM

118

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

5 Answers

Ryan Crosby Mar 15, 2017 at 08:33 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Abhay Aggarwal Mar 16, 2017 at 03:36 AM
0

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,

Share
10 |10000 characters needed characters left characters exceeded
Manoj Kumar Mar 16, 2017 at 06:18 AM
0

Hi Abhay,

Check the below link

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

Regards,

Manoj Kumar

Share
10 |10000 characters needed characters left characters exceeded
Iñaki Vila Mar 16, 2017 at 08:44 AM
0

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.

Share
10 |10000 characters needed characters left characters exceeded
Abhay Aggarwal Mar 16, 2017 at 04:43 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded