cancel
Showing results for 
Search instead for 
Did you mean: 

remove of quotes"' in the sender file adapter -- file content conversion

Former Member
0 Kudos

HI Guys,

MY source file is comma seprated file (,) in the file i had quotes" " for the data like

"5000543","0.00","03/04/2009",

is there any way i can remove the quotes in file content conversion

Please help me on this

Regards

Srinivas

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Thanks for your help

Former Member

Hi Srinivas,

I know you have closed this thread, but would like to point out that there is no need to use a UDF for this.

In your Sender File FCC, use these -

xml.enclosureSign = "

xml.enclosureSignEsc = " "

Regards,

Neetesh

Former Member
0 Kudos

Srinivas,

This should not be a big deal, because your fields are separated by a comma. So you need to keep in mind like you are doing the content conversion for a csv file.

See this blogs for some information:

/people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1

/people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2

In the second blog 1345 there are parameters for content conversion. So similarly mention your conversion parameters in your sender communication channel. So after converting to xml your input fields have values like:

field1: "5000543"

field2: "0.00"

field3: "03/04/2009"

So all your field values has with "". Now you can use either standard replace funciton or a udf as given above and then it will remove the quotes and then you can map according to your requirements. If you think sometimes you can get quotes and sometime not in the file then you can use function like startswith or endswith along with exists and can map accordingly.

Regards,

---Satish

Former Member
0 Kudos

Hi

you can write UDF like bellow or use an function Standar Text ---> Replace


public String replace(String source,char oldChar,String newString){

String toReturn="";
int index=source.indexOf(oldChar);
     if (index!=-1){
           if (index!=0)
              toReturn+=source.substring(0,index-1);
              toReturn+=newString;
              toReturn+=source.substring(index+1,source.length());
     }
return toReturn;
} 

Former Member
0 Kudos

Hi,

FCC does not support that functionality.

Options:

1. Develop a module to delete the quotes.

2. Put a java mapping inside your message mapping

3. Handle it in your message mapping

Regards

Ivan

Former Member
0 Kudos

Jose,

how can i handle it in my message mapping...any inputs?

Srinivas

Former Member
0 Kudos

if the File adapter is giving you the data directly as "5000.00" for a field, use the replace standard fiunction to replace the " to blank

Former Member
0 Kudos

Hi Srinivas,

Develop a UDF:


public string removeQuotes(String a){

if(a.length()>1){
return(a.substring(1,a.length()-1))
}else{
return a;
}

}

Then before any logic map this UDF with your source fields:

sourcefield1->removeQuotes->[your logic]->targetfield

Regards

Ivan