save excel file formatted as f12.3

I

inquirer

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
 
D

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&REPT(" ",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.)
 
I

inquirer

Thanks Dave, I will try that
Chris
Dave Peterson said:
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&REPT(" ",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.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top