+ Reply to Thread
Results 1 to 5 of 5

Export to text file where each cell is a character in the line

  1. #1
    Registered User
    Join Date
    09-18-2015
    Location
    San Francisco
    MS-Off Ver
    2013
    Posts
    3

    Question Export to text file where each cell is a character in the line

    Hi there - I am stuck! I need to take rows of information and export them to a text file in a very specific way. Each cell in a row is a character, so when you export 100 columns of text, that should equal 100 characters in a line.

    For example

    A1 = 3
    B1 = A
    C1 = [space]
    D1 = G

    the output in the text file will be '3A G'

    I can't see how this can be done with the save as and choosing any of the text file options, they seem to use delimited formats that do not match my needs. Is this a script? Anyone know what it would look like??

    TC

  2. #2
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,406

    Re: Export to text file where each cell is a character in the line

    I am not aware of a method of saving files that will do what you want.

    Not sure if this will do everything you want. There is a User Defined Function written by tigeravatar that will concatenate all those characters into a single cell. Saved as a text file it appears to do what you want. You may have to start a new workbook that references your data.

    Please Login or Register  to view this content.
    If you are not familiar with VBA copy the above code. Open the Visual Basic editor (Developer / Visual Basic; or use the keyboard shortcut Alt + F11). Click on Insert on the menu bar. Select Module. An editing window will appear. Paste the code into that window.

    Return to the spreadsheet and enter

    =concatall(A1:D1)

    3A G should appear. This requires that C1 is an actual space character and not just a blank cell.
    Dave

  3. #3
    Registered User
    Join Date
    09-18-2015
    Location
    San Francisco
    MS-Off Ver
    2013
    Posts
    3

    Thumbs up Re: Export to text file where each cell is a character in the line

    Dave, you sir, are a legend. the concatenate worked. I had to find/replace the blank cells with a space as the import in to Excel originally leftthe cells blank rather than adding a space in to that cell. I am now all good - thank you!

    TC

  4. #4
    Registered User
    Join Date
    09-18-2015
    Location
    San Francisco
    MS-Off Ver
    2013
    Posts
    3

    Re: Export to text file where each cell is a character in the line

    Quote Originally Posted by FlameRetired View Post
    I am not aware of a method of saving files that will do what you want.

    Not sure if this will do everything you want. There is a User Defined Function written by tigeravatar that will concatenate all those characters into a single cell. Saved as a text file it appears to do what you want. You may have to start a new workbook that references your data.

    Please Login or Register  to view this content.
    If you are not familiar with VBA copy the above code. Open the Visual Basic editor (Developer / Visual Basic; or use the keyboard shortcut Alt + F11). Click on Insert on the menu bar. Select Module. An editing window will appear. Paste the code into that window.

    Return to the spreadsheet and enter

    =concatall(A1:D1)

    3A G should appear. This requires that C1 is an actual space character and not just a blank cell.
    Concatenate solved my problem - thank you!

  5. #5
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,406

    Re: Export to text file where each cell is a character in the line

    Super! .... and you are welcome.

    Since this answers your question please go to the top of your original post, click Thread tools and mark [SOLVED].

+ 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. Export a cell containing text into a .docx file - keep formatting
    By ocor in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-22-2014, 05:28 PM
  2. Export each row as text file using first cell in row as title
    By aaronmb in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-11-2013, 06:40 AM
  3. export excel to text file; multiple line cells; no quotes
    By redbu11 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-11-2012, 01:57 AM
  4. Export to Text File Starting Cell Point?
    By mfleming in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-02-2011, 02:27 PM
  5. [SOLVED] importing undelimited text file data, character-by-character
    By The Mos$ in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-26-2005, 07:10 AM
  6. [SOLVED] Cell export to Text File?
    By Steve in forum Excel General
    Replies: 3
    Last Post: 12-07-2005, 11:15 AM
  7. [SOLVED] How can I export cell content in Excel to a text file?
    By documentum_dan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-07-2005, 02:06 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