+ Reply to Thread
Results 1 to 4 of 4

.xlsx to unicode .txt conversion: how do I get the columns straight?

  1. #1
    Registered User
    Join Date
    03-30-2016
    Location
    USA
    MS-Off Ver
    2016
    Posts
    49

    .xlsx to unicode .txt conversion: how do I get the columns straight?

    My company works with an outsource group that sends letters for us. We have no control over their business practices and software.

    They're insisting that they can only take .txt (unicode version) files.

    We're sending them mailings so we have Name, address, address line 2, dates, and a few other pieces of information.

    In Excel as a .xlsx file I naturally have it lined up in nice neat rows. When I save it into a .txt file, the nice neat rows are no longer nice and neat. It's causing problems where the date field is getting messed up. Dates of say 1/19/2020 are coming through as "11/1/91".

    I need to figure out what's wrong with the dates, but to do that I need to get the columns to convert over and be straight.

    How do I get the columns to be lined up in a .txt file I'm converting from a .xlsx file? I want them lined up by the left side of the cell so that (for example) the first letter of everyone's first name is lined up on the left side of the column.

    As always, your assistance is greatly appreciated.

  2. #2
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: .xlsx to unicode .txt conversion: how do I get the columns straight?

    The following code exports all worksheets in a workbook to fixed-width files. The code is commented for use in either of two modes, to determine the columns widths based on the:
    • text width in Row 1; or
    • value in Row 1
    in the worksheet being exported. The second version also allows for left/right alignments to be set on the basis on a value in row 2.
    Please Login or Register  to view this content.
    Do note, though, that even with this code, your columns will only look straight if you view the output with a fixed-width font (e.g. Courier New).
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

  3. #3
    Registered User
    Join Date
    03-30-2016
    Location
    USA
    MS-Off Ver
    2016
    Posts
    49

    Re: .xlsx to unicode .txt conversion: how do I get the columns straight?

    Quote Originally Posted by macropod View Post
    The following code exports all worksheets in a workbook to fixed-width files. The code is commented for use in either of two modes, to determine the columns widths based on the:
    • text width in Row 1; or
    • value in Row 1
    in the worksheet being exported. The second version also allows for left/right alignments to be set on the basis on a value in row 2.
    Please Login or Register  to view this content.
    Do note, though, that even with this code, your columns will only look straight if you view the output with a fixed-width font (e.g. Courier New).
    Thank you for the thoughtful reply. I am hoping there is a way to do it without a macro/code. Is that possible or no?

  4. #4
    Registered User
    Join Date
    12-05-2019
    Location
    usa
    MS-Off Ver
    2007
    Posts
    7

    Re: .xlsx to unicode .txt conversion: how do I get the columns straight?

    Try Save As a .PRN file and see if it covers your requirements.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] .CSV to .XLSX Automatic Batch Conversion
    By prosemur in forum Excel Programming / VBA / Macros
    Replies: 26
    Last Post: 08-27-2021, 11:35 PM
  2. [SOLVED] XLSX to PDF conversion in Excel 2007
    By Jackal80 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-12-2014, 09:39 AM
  3. Batch .iqy to xlsx conversion
    By nickfan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-15-2013, 09:32 AM
  4. How to add the columns data of several xlsx files of a folder in another xlsx file
    By ravikumar00008 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-25-2012, 04:29 AM
  5. Replies: 6
    Last Post: 04-19-2012, 03:27 PM
  6. xlsx top html conversion
    By rob171171 in forum Excel General
    Replies: 0
    Last Post: 03-14-2012, 03:29 AM
  7. unicode file conversion
    By ashishprem in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-15-2008, 03:44 AM

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