0

Output from RetrieVe and UniVerseSQL both drop spaces that precede a new line.

The single valued attribute I'm extracting contains several thousand characters of XML with no line breaks. Output is severely truncated unless applying a FMT such as '79L' which causes it to wrap at the specified screen width, which in my case is 79. That is all fine except for one detail.

Any space immediately preceding the new line is omitted, wrecking the XML even after the line breaks are removed in the destination system.

Is there a way to force the output to retain the trailing space on a line? Maybe an alternative terminal emulation? Or a way to send the content straight to an AIX operating system text file with the spaces intact?

I tried using FMT with L, R and C which all had identical results. T caused it to break on a space but still did not include any trailing spaces on the line. Same results to terminal or print spooler.

One workaround would be post processing it line by line before it is imported to SQL Server but I'm hoping to avoid this.

Galaxiom
  • 109
  • 4
  • 1
    Do you happen to use a shell-script for post-processing? E.g. `while read N; do echo "$N"; done`. Change it to `while IFS= read -r N; do printf "%s\n" "$N"; done` – Lorinczy Zsigmond Jul 19 '23 at 19:37
  • Thanks for your reply. I am not great at scripts in AIX. I was thinking of doing it in Windows or put it into SQL server and process there but it would be nice on the server too. It would need to find any line with less then 79 characters add a space to the end of it then remove the newline character. – Galaxiom Jul 21 '23 at 06:44
  • That's doable. E.g. `while IFS= read -r Line; do printf "%-79s" "$Line"; done` – Lorinczy Zsigmond Jul 21 '23 at 08:15

0 Answers0