+ Reply to Thread
Results 1 to 6 of 6

Excel to Notepad - Aligning columns

  1. #1
    Registered User
    Join Date
    01-12-2012
    Location
    Dublin
    MS-Off Ver
    Excel 2010
    Posts
    50

    Excel to Notepad - Aligning columns

    Hi,
    I need to format a spreadsheet in Excel so that when it is saved as a .txt (Notepad) file it has all its columns aligned from the left side, like that displayed below.

    CELLID DATE CI DROP_TCH DROP_PCT
    G10041A 01/09/2008 12345 417 5 0.84 3.4

    I have tried using the rept function with combinations of right and left functions but I cannot get it to work efficiently. I have attached the file. One other problem is in column D the numbers are displayed to two decimal points although the numbers themselves have up to 8 decimal points. When saving as a text file I need only the number in two decimal points or a number of points that I specify. You can see the functions I have used in Cell G1 and issues can easily be noticed. Any help is greatly appreciated.
    Cheers,
    Daithi
    Attached Files Attached Files
    Last edited by kinseld5; 02-06-2012 at 12:08 PM.

  2. #2
    Registered User
    Join Date
    01-12-2012
    Location
    Dublin
    MS-Off Ver
    Excel 2010
    Posts
    50

    Re: Excel to Notepad - Aligning columns

    Hi,
    Just noticed the display autofits when it is saved on the thread. I have attached a .txt file to show the required layout. Sorry for the confusion.
    Daithi
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    01-12-2012
    Location
    Dublin
    MS-Off Ver
    Excel 2010
    Posts
    50

    Re: Excel to Notepad - Aligning columns

    Bump no response

  4. #4
    Forum Contributor
    Join Date
    12-28-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    280

    Re: Excel to Notepad - Aligning columns

    Hi

    Try saving it as a .prn (space delimited) file. You need to set the column widths within your Excel file as desired before you use the SaveAs option.

    If you want, you can change the extension to .txt following a successful save.

  5. #5
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,646

    Re: Excel to Notepad - Aligning columns

    I can't see the problem: saving as a txt-file lead to the values in the worksheet separated by the fieldseperator.

    Any program 'reading' that textfile will ignore the formatting, because that's what storing as a txt file is all about.
    Why do you need formatting in a non-formatting fileformat ?



  6. #6
    Forum Contributor
    Join Date
    12-28-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    280

    Re: Excel to Notepad - Aligning columns

    snb, you haven't seen fixed width text files before?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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