+ Reply to Thread
Results 1 to 3 of 3

save excel file formatted as f12.3

  1. #1
    inquirer
    Guest

    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



  2. #2
    Dave Peterson
    Guest

    Re: save excel file formatted as f12.3

    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.)

    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

  3. #3
    inquirer
    Guest

    Re: save excel file formatted as f12.3

    Thanks Dave, I will try that
    Chris
    "Dave Peterson" <[email protected]> wrote in message
    news:[email protected]...
    > 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.)
    >
    > 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




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1