ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   save excel file formatted as f12.3 (https://www.excelbanter.com/excel-discussion-misc-queries/30367-save-excel-file-formatted-f12-3-a.html)

inquirer

save excel file formatted as f12.3
 
I have an excel file with 14 columns. I want to save this as a text file
with all columns 12 characters wide and those columns which are numeric to 3
decimal places. All other columns if empty should contain 12 spaces. Columns
which contains alphas should be left justified; colmns containing numerics
should be right justified.
Is there an easy way to do this?
Thanks
Chris



Dave Peterson

I'd use 15 helper columns.

Say your data is in A1:Nxxx

I'd put this formula in O1:
=IF(ISNUMBER(A1),TEXT(A1,"00000000.000"),LEFT(A1&R EPT(" ",12),12))
And drag to cell AB1.

Then in the 15 helper cell AC1, I'd put this formula:

=O1&P1&Q1&R1&S1&T1&U1&V1&W1&X1&Y1&Z1&AA1&AB1

Then I'd drag all 15 helper formulas down the rows I need.

Finally, I'd select column AC and copy, start up NotePad and paste there.

Then finally save to the text file from notepad.

(Keep the formulas (hide the columns) if you have to do this over and over and
over.)

inquirer wrote:

I have an excel file with 14 columns. I want to save this as a text file
with all columns 12 characters wide and those columns which are numeric to 3
decimal places. All other columns if empty should contain 12 spaces. Columns
which contains alphas should be left justified; colmns containing numerics
should be right justified.
Is there an easy way to do this?
Thanks
Chris


--

Dave Peterson

inquirer

Thanks Dave, I will try that
Chris
"Dave Peterson" wrote in message
...
I'd use 15 helper columns.

Say your data is in A1:Nxxx

I'd put this formula in O1:
=IF(ISNUMBER(A1),TEXT(A1,"00000000.000"),LEFT(A1&R EPT(" ",12),12))
And drag to cell AB1.

Then in the 15 helper cell AC1, I'd put this formula:

=O1&P1&Q1&R1&S1&T1&U1&V1&W1&X1&Y1&Z1&AA1&AB1

Then I'd drag all 15 helper formulas down the rows I need.

Finally, I'd select column AC and copy, start up NotePad and paste there.

Then finally save to the text file from notepad.

(Keep the formulas (hide the columns) if you have to do this over and over
and
over.)

inquirer wrote:

I have an excel file with 14 columns. I want to save this as a text file
with all columns 12 characters wide and those columns which are numeric
to 3
decimal places. All other columns if empty should contain 12 spaces.
Columns
which contains alphas should be left justified; colmns containing
numerics
should be right justified.
Is there an easy way to do this?
Thanks
Chris


--

Dave Peterson





All times are GMT +1. The time now is 07:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com