Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
We are aware of an issue with the Product Downloads page and looking into it.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] String padding with space?

Hello,
When I tried to import "StringUtils" it fails at execution
StringUtils.rightPad(val, ln, ' ')
Any other idea to padd with space a string and avoid automatic "TRIM".
Kind regards,
JNB
Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

In fact, it was a bug resolved in TOS 3.2.3
see bugTracker 0012692 for more details!
Special Thanks to MHIRT for prompt reply on BugTracker!
JNB

View solution in original post

3 Replies
Anonymous
Not applicable
Author

with the use of ( StringBuilder sb = new StringBuilder(); ... sb.append(' ');
the output String is also trimed...
I wander how it succeeds in an outputPositionalFile when padding char is used with a StringBuilder...
Anonymous
Not applicable
Author

The trouble is that I have an outputFileDelimited that is a mix between a CSV file and a positional file
field separator " "
CSV options file with Escape char "\"" and Text enclosure as well "\""
so I can manage to generate:
"4" "AIEOxxxx" "1"
"4" "AIxxxxxx" "0"
but not
"4" "AIEO " "1"
"4" "AI " "0"
I always have
"4" "AIEO" "1"
"4" "AI" "0"
as the " text enclosure is added after data manipulation and the String is trimed automatcically; spaces are deleted!!
It seems complicated to deal with these schema. (I use TOS 3.1.4)
In the positional file, I can't have text enclosure and in the delimeted file, I can't pad with space!!
Any help would be much appreciated!
kind regards,
JNB
Anonymous
Not applicable
Author

In fact, it was a bug resolved in TOS 3.2.3
see bugTracker 0012692 for more details!
Special Thanks to MHIRT for prompt reply on BugTracker!
JNB