2

I have to replace a string literal with the delimiter coming form mysql resultset.

String str1 = value.replace(" - ", mysqlDelimiterValue);

Here i am passing delimiter into variable mysqlDelimiterValue. If there is any escape character in the delimiter value then instead of generating that escape character as delimiter into data file it converting that delimiter value into string and writing into data file.

For Example:

My input file record is: "a - b - c - d"
My delimiter is: "\t" (tab delimiter)
Expected output: "a   b   c   d"(delimited by tab)
Actual output: "a\tb\tc\td"

Here my delimiter is dynamic. So i want to make this one as generalized one which support any delimiter. Please help me... thanks in advance...

Gokul Potluri
  • 262
  • 4
  • 16

0 Answers0