How to use different separator for flex monster compressor data rather than default comma separator

Hi Team,
I want use different separator while compressing  flex monster data using flex monster compressor.By default its taking comma (,) as default separator .Due to comma separator i am getting some wrong data while using number format in my project . Suppose if have any number data which contains comma then flex monster treating it as new column.
 
Can you please tell is fieldSeparator option is there for “ocsv” datatype ?Because in my project if it is a csv datatype if it contains ‘~’ as a separator , if i am configuring fieldSeparator as ‘~’ then its working but for ocsv type this option is not working.

Please find the attached screen shot.
Regards,
Manoranjan
 

Attachments:
flex.jpg

5 answers

Public
Tanya Gryshko Flexmonster April 5, 2019

Hello, Manoranjan,

Thank you for writing to us.

If you are compressing the data from the database, Flexmonster Compressor does not need any fieldSeparators specified. In case you want to compress CSV file that contains ‘~’ as a separator, it can be specified as a second argument:

InputStream compressFile(String fileName, char delimiter)

Alternatively, for strings in CSV format and streams:

InputStream compressString(String string, char delimiter)
InputStream compressStream(InputStream inputStream, char delimiter)

Please let us know if it helps.

Regards,
Tanya

Public
manoranajan April 8, 2019

Hi Tanya,
Thank you for the response.
The above solution is not working for “ocsv” dataSourceType .
Please find the attached project in zip format
 

Public
manoranajan April 9, 2019

Hi Team,
Could you please respond on this ASAP ?
Regards,
Manoranjan
 

Public
Vera Didenko Flexmonster April 10, 2019

Hello, Manoranjan,
 
Thank you for your reply and for sharing a code sample.
It helped us a lot to understand the problem with preformatted numbers better and reproduce it on our side.
 

As a result, we noticed that the issue occurs when the decimal separator is “,”.

Our team is currently working on a solution to this issue and the fix will be available in the minor release with the ETA May 6th.

 
We kindly advise passing raw (not preformatted) data to Flexmonster Compressor. 

Please note that raw number data can be formatted on the client side in Flexmonster via the thousandsSeparator and decimalSeparator option in the formats parameter.
This can be achieved the following way:


"formats": [
{
"name": "2sfou03a",

/* SET DESIRED SEPARATOR FOR THOUSANDS */
"thousandsSeparator": ",",

/* SET DESIRED SEPARATOR FOR DECIMALS */
"decimalSeparator": ".",

"decimalPlaces": 2,
"currencySymbol": "$",
"positiveCurrencyFormat": "$1",
"nullValue": "",
"textAlign": "right",
"isPercent": false
}
]

 
 
We have prepared a few JSFiddle examples for illustration:
 
1) In this JSFiddle example, it is shown how the number format can be predefined in Flexmonster via the formats parameter.
2) In this JSFiddle example, you can see how the number format can be changed during runtime.
 
Could you please provide more information on how and where you get your data? It would greatly help us.
 
Please let us know if passing raw data would work for you.
 
We are looking forward to hearing from you.

Best Regards,
Vera

Public
manoranajan April 10, 2019

Hi Vera,
Thank you for quick response.
We are getting data from service call only and in our case we are using compress data only i.e ocsv type . We can not use raw data.
We will wait for the fix in the minor release.
Regards,
Manoranjan

Please login or Register to Submit Answer