cancel
Showing results for 
Search instead for 
Did you mean: 

Content Conversion

Former Member
0 Kudos

Hi everyone,

Would anybody know how to remove double quotes in an text file during File content conversion?

Here's an example of the file structure,

"ABC","11-17-2006","13:11:09",75163,"1","","",90,"price_discount",".0000"

"ABC","11-17-2006","13:11:09",75163,"1","","",91,"price_affb",".0000"

"ABC","11-17-2006","13:11:09",75163,"1","","",92,"price_affb_used","N"

"ABC","11-17-2006","13:11:09",75163,"1","","",93,"price_fet",".0000"

"ABC","11-17-2006","13:11:09",75163,"1","","",94,"price_fet_used","N"

"ABC","11-17-2006","13:11:09",75163,"1","","",95,"price_aft",".0000"

"ABC","11-17-2006","13:11:09",75163,"1","","",96,"price_aft_used","N"

"ABC","11-17-2006","13:11:09",75163,"1","","",97,"price_bcref",".0000"

"ABC","11-17-2006","13:11:09",75163,"1","","",98,"price_bcref_used","N

As you can see, the file is comma delimited. I just want in addition, to remove the double quote!

Is that possible, and if yes, how?

Thank you very much in advance for your collaboration!

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

I'm good to go with your suggestions Statish & Koen!

Thank you very much for your contribution!

Former Member
0 Kudos

Hi again,

Thanks for the suggestion, but when I don't put anything in the third value for ReplaceString, my target get field gets a yellow status, is that normal?

Regards,

Former Member
0 Kudos

If you dont put anything there then your target field will have the same source value, but without the double quotes.

Else if you dont have any value in the source then it will have no value in the target. Dont worry about that. Only thing you have to make sure is immaterial of the value present or not you should always have a comma inbetween the fields in the file.

---Satish

Former Member
0 Kudos

Hi,

Use an empty constant ([]) as the thrid input.

Kind regards,

Koen

Former Member
0 Kudos

Hi Satish,

You are wright, the pattern is a mixture of double quotes and some field do not have double quotes!

Therefore the begin.separator will not work in this particular case!

Unfortunately the file is coming from a third party, we do not have control at this point!

If I can't remove the double quotes in the file content conversion, could it be done in the mapping, and how?

Thanks

Former Member
0 Kudos

Tersant,

I have one option for you. What you can do is read the file using .fieldSeparator as , and so all your fields comes into XI as "<value>" in this pattern or only value (since for numbers you dont have double quotes).

In mapping you do onething. Read the value and use the standard funciton replacestring in text function. So you pass your value in the first parameter and in the second parameter you give " and in the third parameter dont give anything. So in the end you will not have double quotes to your field. Then from there do the rest of the mapping.

Example"

"Satish"

"

[] ---> Give this three parameters to Replacestring -->Then you will have the value as Satish. Then do rest of your mapping.

---Satish

Former Member
0 Kudos

Hi,

Also I see in your file the no. 75163,"1" is not having double quotes. So it is a mixture of double quotes and none in the file.

If it is this pattern you will not able to read the file, so make sure every field has a double quote along with the number and the character.

---Satish

Former Member
0 Kudos

Tersant,

In file sender communication channel you give the following parameters:

.beginSeparator : "

.fieldSeparator : ","

.endSeparator : "'nl'

Then you will be able to read the file.

---Satish