Hi, we are using convertToString, where we are trying to
create a file with field delimiter as pipe(|) and record delimiter as ‘carriage return’. In the data fields we have | , so we are using quoted release character as ".
we also have colon( in data, so whenever we have colon, the convertToString service is enclosing that value in quotes too.
our input file looks like
the result is coming as
the “gh|k” is as expected, but we are also getting quotes for “cd:ef”.
seems like Integration server is considering : as some field delimiter. any thoughts?
So you want to avoid colon in the data? Probable solution may be try using formatService specification and have the replace function in the particular field that has issue with and check the string output:
I want to avoid quotes to the field which has colon :
I was not expecting quotes to the field “cd:ef”., in above example.Why is IS even enclosing the field cd:ef in quotes when I am not specifying colon anywhere. colon is just part of data.
will try how to use format servie. Thanks.
I suspect that : is defined as a subfield delimiter in the FF schema. It may be a default delimiter. That’s why it is putting the quotes around the data.
Specify a different subfield delimiter if you want to eliminate the quotes.
But ultimately, flat file convention is such that the quotes are harmless. They are only an indicator to “treat delimiter chars as literal data”. The quotes are not considered to be part of the data.
We are not using any subfield delimiter. anway I have to check what a default delimiter is. I understand the quotes will be harmless, but i wonder why it is even putting the quotes if the field has colon in it.
Can you share the details of:
- The ffSchema being used.
- The inputs to the covertToString call.
Somewhere : is being assumed to be the subfield delimiter. It is there even if you’re not using subfields. That’s why it is putting the quotes.
The schema is a delimited one with
record delimiter as newline
field delimiter as pipe (|)
and quoted release character as (")
and NO subfield delimiter
The inputs to convertToString are
ffvalues is a doc
ffSchmea is the ablove schema name
Encoding is UTF-8
returnAsBytes is false
its all straight forward
Did you try using format Service option?
Yes, I tried using the format service, but I dont want to format the value cd:ef to something else, I was expecting the
value as is in the output without quotes around it.
I believe since you have the quoted release character as " in place the convert to string is putting that by default and may be its a bug or any fix to eliminate it or standard output:
In the past I’ve experienced that defaults sneak in when you don’t expect them to. Try specifying a subfield delimiter of some sort and see if it still puts quoted release chars around fields with :
As you said, looks like colon sneaked in as a subfield delimiter. I specified a different subfield delimiter(say ^), and its working fine now. Is there a way out of this, without explicitly specifying a subfield delimiter.
No other decent way with out it.Glad it worked out for you:
Just FYI…may help other with same issue–
We had an incident open with SAG. They said that ‘:’ is the default subfield delimiter and suggested us to use a value other than ‘:’ as a way out of this. So NO config settings/fixes to solve this