Shane Johnson wrote:
I could use some help please.
I am trying to mimic something I did all the time in Excel and need
to do in Calc. I need to export a calc file as a space delimited text
file with the column width set at:
Column 1 22 Characters
Column 2 1 Character
Column 3 5 Characters
I have searched the mail archives and can't find anything on this. I
have tried save as a CSV files and formatting it as fixed width but I
can't get it to work right. With Excel I would just get the data into
the columns I needed and then size the columns by the number of
characters that I needed in the column and then export it to a space
delimited file. Please let me know the best way to do this. If I need
to use something besides inches for the measurement of the column width
I can do that but I need to know how to figure out how to do it. I
appreciate your help.
Shane
As your own experience and attempts by others to help have indicated,
OOo Calc does not do this well at all. I recall trying this once many
months ago and giving up in disgust. (On the other hand, Excel does this
will but stupidly uses that current display width of columns to
calculate to maximum number of characters in a field when exporting to a
database file.)
But there is an entirely different brute force approach.
I am assuming that the data for column 1 is in Column A in the
spreadsheet, the data for column 2 is in Column B in the spreadsheet,
and the data for column 3 is in column C in the spreadsheet.
Accordingly, in cell D1 place the following formula:
=LEFT(A1 & REPT(" ";22);22) & LEFT(B1 & " ";1) & LEFT(C1 & REPT(" ";5);5)
Propagate this formula into the corresponding formulas down column D.
Each cell in column D now evaluates to the text record you wish to
create. So manually select the data in column D down to its last row.
copy the selected area, paste it into a text editor, and save it under
whatever name you wish.
You can also paste it into OOo Writer and save from there as text,
provided you use "Paste Special" (or CTRL-SHIFT-V) and select
"Unformatted text". Setting the font to a fixed-width font like Courier
or Courier New and using CTRL-F10 to make the line-ends visible gives
easy verification that everything is lined up as it should be.
A macro could be written to do the copying, pasting into OOo Writer and
the subsequent saving.
Jallan
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]