+ Reply to Thread
Results 1 to 7 of 7

Convert Text to Table (Space Delimited or Fixed length)

  1. #1
    Registered User
    Join Date
    11-15-2019
    Location
    Pakistan
    MS-Off Ver
    2019
    Posts
    3

    Convert Text to Table (Space Delimited or Fixed length)

    Hello Guys,

    I have a text file with tab delimited data (150 lines) that i want to convert to space delimited or fixed length columns. I have tried to export the file using Excel's .prn format but when opened in MS Notepad it loses all formatting.

    Let us consider the file as:
    Please Login or Register  to view this content.
    Now what is want is this:
    Please Login or Register  to view this content.
    I have used this tool and it does the job but again when saving in MS Notepad, the columns are misalinged and i want the data only in Notepad...
    P.S. Is there anyway to do it using any tool that works in Notepad..EXCEL.CMD.SHELL.
    Thanks in Advance...!
    Last edited by mujtabaustad; 11-24-2019 at 04:58 AM.

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    Excel 2010 on Linux - O365
    Posts
    12,576

    Re: Convert Text to Table (Space Delimited or Fixed length)

    Administrative Note:

    Hi and welcome
    although we value privacy as much as anyone else, it could be important that members have a rough idea of your location. You might in the future post questions which are bound to your regional settings.
    So, please update your profile to something more precise then "Lives at Moon" ( country will suffice, no need to be more precise).
    Thank you for helping us to help you

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel (Windows 11 64-bit)
    Posts
    60,497

    Re: Convert Text to Table (Space Delimited or Fixed length)

    Administrative Note:

    Welcome to the forum.

    Although we value your privacy as much you do, it could be important that members have a rough idea of your location as the solutions they offer may be affected by your locale. For instance, you might in the future post questions which are related to your regional settings.

    With this in mind, please update your profile to something more precise (something such as UK, Europe, USA, UAE, etc. will suffice).

    Thank you for helping us to help you.

    Why are you exporting as .prn? Why not .txt?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" to anyone who has offered you help in your thread. You can reward them by clicking on * Add Reputation below theur user name on the left, if you wish.


    Forum Rules (updated September 2018): please read them here.
    How to use the Power Query code you've been given: help here. More about the Power suite here.

  4. #4
    Registered User
    Join Date
    11-15-2019
    Location
    Pakistan
    MS-Off Ver
    2019
    Posts
    3

    Re: Convert Text to Table (Space Delimited or Fixed length)

    Allright, will do that.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel (Windows 11 64-bit)
    Posts
    60,497

    Re: Convert Text to Table (Space Delimited or Fixed length)

    You didn't answer my question:

    Why are you exporting as .prn? Why not .txt?

  6. #6
    Registered User
    Join Date
    11-15-2019
    Location
    Pakistan
    MS-Off Ver
    2019
    Posts
    3

    Re: Convert Text to Table (Space Delimited or Fixed length)

    As i described earlier that the text file is tab delimited, so after saving as .txt file which is also tab delimited format, nothing works. On the other hand .prn file which is space delimited, this works with some files but unfortunately not with this one. I don't know why.
    Last edited by AliGW; 11-24-2019 at 05:19 AM. Reason: Please don't quote unnecessarily!

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel (Windows 11 64-bit)
    Posts
    60,497

    Re: Convert Text to Table (Space Delimited or Fixed length)

    OK, well clearly it's to do with the file in question. We can't possibly know why any more than you without seeing the file.

+ 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. Replies: 4
    Last Post: 08-20-2013, 03:07 AM
  2. Convert freeform user input and write to a fixed length text file
    By vijaymohan10 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-02-2013, 04:44 AM
  3. Macro to convert a mutiple sheet workbook to tab delimited text or fixed width text file
    By chandra 2185 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-05-2012, 10:29 AM
  4. Convert fixed width text to table in word. It's not that easy!
    By stani87slav in forum Word Formatting & General
    Replies: 0
    Last Post: 10-04-2010, 08:03 AM
  5. Convert space-delimited data to columns
    By rupz11 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 06-19-2009, 07:42 AM
  6. VBA to add leading o's and trailing space for fixed length SIR fields
    By Zyphon in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-03-2008, 08:51 AM
  7. Export file to CSV delimited with fixed field length
    By Plucky Duck in forum Excel General
    Replies: 2
    Last Post: 05-28-2005, 06:05 PM
  8. [B]Convert number to fixed length text[/B]
    By BernzG in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-20-2005, 06:00 PM

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