On Wed, 24 Mar 2021 16:17:10 +0000, Chris Hoelscher wrote:

>Wouldn't just transforming the mainframe data to CSV format and downloading 
>work?
> 
Indeed.  Then open the .CSV with Excel/LibreOffice and Save as .XLS.

But the hard part is "just" transforming the mainframe data to CSV,
as other plies in this thread explain.


On Wed, 24 Mar 2021 10:53:05 -0700, Tom Brennan wrote:
>
>"12DE","12DF","12E0","12E1"
>
>The first two are fine, but the next 2 are interpreted as exponential
>notation regardless of the quotes.  One way around this is to make the
>value ="12E0" once it arrives in Excel, but even that is difficult in
>CSV - something like this might be required:
>
>"=""12DE""","=""12DF""","=""12E0""","=""12E1"""

I tried the followibg: 
524 $ cat awkq
# Doc: Convert each field to .CSV-friendly format.
{ for ( I = 1; I <= NF; I++ ) {
    gsub( /\"/, "\"\"", $I )   # Double internal quotes.
    sub( /^/, "\"=\"\"", $I ) # Add leading "="".
    sub( /$/, "\"\"\",", $I ) } # Add trailing """,.
  sub( /,$/, "", $0 )  # remove trailing ,.
  print( $0 ) }
525 $ 
522 $ awk -f awkq | tee foo.csv

Which converted:
12DE 12DF 12E0 12E1 
12DE 12DF 12E0 12E1   foo"bar  

To:
"=""12DE""", "=""12DF""", "=""12E0""", "=""12E1"""
"=""12DE""", "=""12DF""", "=""12E0""", "=""12E1""", "=""foo""bar"""

Which almost worked, but on the last item, LibreOffice said, "Err:509."

Is it LibreOffice, or is it me?

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to