utah-parser icon indicating copy to clipboard operation
utah-parser copied to clipboard

Trimming of values differently implemented in JSON versus CSV export

Open sgoeschl opened this issue 4 years ago • 3 comments

I'm working with fixed-with column and some of the values are variable-length strings (also having spaces) and they could be left or right-aligned.

In theory it is possible to come up with a regex trimming the unwanted spaces but in reality it is hard since the regexp becomes hard to maintain (and I have many of them)

Depending on the output format

  • JSON - the values are NOT trimmed
  • CSV - the values are trimmed

Would it make sense to trim the value in general? Our should/could this be a setting (global, field level)?

sgoeschl avatar Nov 08 '21 17:11 sgoeschl

Would it make sense to trim the value in general?

We had thought of this, but were a little cagey about second-guessing the config files. So we chose to always trust the regex.

This seems like a very specific use case; can you explain what kind of config you're thinking of?

daniel-bray-sonalake avatar Nov 09 '21 18:11 daniel-bray-sonalake

Actually not thinking of anything - asking for your feedback :)

In my case I am generating CSV or HTML (based on the CSV) using FreeMarker templates

sgoeschl avatar Nov 09 '21 18:11 sgoeschl

Let us ponder this one a little

daniel-bray-sonalake avatar Nov 10 '21 08:11 daniel-bray-sonalake