+ Reply to Thread
Results 1 to 34 of 34

How to have this output and export to text file?

  1. #1
    Registered User
    Join Date
    05-22-2011
    Location
    Philippines
    MS-Off Ver
    Microsoft Office LTSC Professional Plus 2021
    Posts
    65

    Question How to have this output and export to text file?

    ISSUE # 1 (SOLVED)
    Attachment 810613

    Output should be as what is shown on the image.

    Any help is appreciated.

    Output disregards decimal point and concatenates the numbers instead.
    ex. 12,140.86 becomes 1214086
    Output has 23 digits with leading zeroes based on input
    18700003 is constant and part of the 23 digits

    EDIT:
    I have added an excel file and a sample text file based on the solution for issue #1

    ISSUE #2 : How to export this excel file into a text file that looks exactly like my attached Textfile.txt (including character spaces)Attachment 810614Attachment 810615?

    Kindly refer to this picture Attachment 810628 this is the desired text output.

    Thank you for your assistance!
    Last edited by kraddark; 12-24-2022 at 11:49 AM. Reason: Marked as SOLVED

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: How to have this output?

    Try:
    =REPT(0,23-(LEN(100*A1)+8))&100*A1&18700003

    copied down.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,039

    Re: How to have this output?

    Or, =RIGHT(REPT("0",23)&A1*100&18700003,23)

  4. #4
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: How to have this output?

    maybe try this

    F
    G
    H
    I
    21
    src
    len
    result
    22
    0.00
    23
    00000000000000018700003 =BASE(F22*100,10,15)&"18700003"
    23
    12140.86
    23
    00000000121408618700003
    24
    2500.00
    23
    00000000025000018700003
    25
    123.00
    23
    00000000001230018700003
    26
    9034569.00
    23
    00000090345690018700003
    27
    676767.00
    23
    00000006767670018700003
    28
    1111111111.00
    23
    00011111111110018700003

  5. #5
    Registered User
    Join Date
    05-22-2011
    Location
    Philippines
    MS-Off Ver
    Microsoft Office LTSC Professional Plus 2021
    Posts
    65

    Re: How to have this output?

    Quote Originally Posted by Glenn Kennedy View Post
    Try:
    =REPT(0,23-(LEN(100*A1)+8))&100*A1&18700003

    copied down.
    Thanks, this one works.

  6. #6
    Registered User
    Join Date
    05-22-2011
    Location
    Philippines
    MS-Off Ver
    Microsoft Office LTSC Professional Plus 2021
    Posts
    65

    Re: How to have this output?

    Quote Originally Posted by sandy666 View Post
    maybe try this

    F
    G
    H
    I
    21
    src
    len
    result
    22
    0.00
    23
    00000000000000018700003 =BASE(F22*100,10,15)&"18700003"
    23
    12140.86
    23
    00000000121408618700003
    24
    2500.00
    23
    00000000025000018700003
    25
    123.00
    23
    00000000001230018700003
    26
    9034569.00
    23
    00000090345690018700003
    27
    676767.00
    23
    00000006767670018700003
    28
    1111111111.00
    23
    00011111111110018700003
    Thank you.

  7. #7
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: How to have this output?

    You are welcome

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: How to have this output?

    You're welcome.



    It would be very nice if you were to just click the Add Reputation button at the foot of any of the posts of members who helped you reach a solution.

    Finally, if that takes care of your original question, please click on "Thread Tools" from the menu link (just above the first post in the thread) and mark this thread as SOLVED.

  9. #9
    Registered User
    Join Date
    05-22-2011
    Location
    Philippines
    MS-Off Ver
    Microsoft Office LTSC Professional Plus 2021
    Posts
    65

    Re: How to have this output?

    Quote Originally Posted by Glenn Kennedy View Post
    You're welcome.



    It would be very nice if you were to just click the Add Reputation button at the foot of any of the posts of members who helped you reach a solution.

    Finally, if that takes care of your original question, please click on "Thread Tools" from the menu link (just above the first post in the thread) and mark this thread as SOLVED.
    I have edited my post, I added another issue. I hope you can help me on this one too. Thank you.

  10. #10
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: How to have this output and export to text file?

    Why not just copy paste into Notepad and save as .TXT?

  11. #11
    Registered User
    Join Date
    05-22-2011
    Location
    Philippines
    MS-Off Ver
    Microsoft Office LTSC Professional Plus 2021
    Posts
    65

    Re: How to have this output and export to text file?

    It's because I need it to look exactly like the contents of the text file (kindly check) that I attached. That also includes concatenation and character spaces.

  12. #12
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: How to have this output and export to text file?

    Your second attached image shows nothing! It's jet black...

  13. #13
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: How to have this output and export to text file?

    IGNORE ME. I just spotted thta there are two attachments. Duhhh!

  14. #14
    Registered User
    Join Date
    05-22-2011
    Location
    Philippines
    MS-Off Ver
    Microsoft Office LTSC Professional Plus 2021
    Posts
    65

    Re: How to have this output and export to text file?

    Quote Originally Posted by Glenn Kennedy View Post
    IGNORE ME. I just spotted thta there are two attachments. Duhhh!
    Yup, those attachments are kinda misplaced. Sorry.

  15. #15
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: How to have this output and export to text file?

    OK.

    1. Change the font to Courier New.

    2. Use this formula in A1, copied down.

    =INPUT!A1&REPT(" ",5)&INPUT!B1&REPT(" ",25-LEN(INPUT!B1))&REPT(0,23-(LEN(100*INPUT!C1)+8))&100*INPUT!C1&18700003

    3. Copy / paste into Notepad.
    Attached Files Attached Files

  16. #16
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: How to have this output and export to text file?

    You can muck around with the spacing by adjusting the bits in RED:

    =INPUT!A1&REPT(" ",5)&INPUT!B1&REPT(" ",25-LEN(INPUT!B1))&REPT(0,23-(LEN(100*INPUT!C1)+8))&100*INPUT!C1&18700003

    If you make the 2nd one too short, you'll get an error.

  17. #17
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: How to have this output and export to text file?

    there is no spaces before names (post#1, TextFile.txt)

  18. #18
    Registered User
    Join Date
    05-22-2011
    Location
    Philippines
    MS-Off Ver
    Microsoft Office LTSC Professional Plus 2021
    Posts
    65

    Re: How to have this output and export to text file?

    Quote Originally Posted by Glenn Kennedy View Post
    You can muck around with the spacing by adjusting the bits in RED:

    =INPUT!A1&REPT(" ",5)&INPUT!B1&REPT(" ",25-LEN(INPUT!B1))&REPT(0,23-(LEN(100*INPUT!C1)+8))&100*INPUT!C1&18700003

    If you make the 2nd one too short, you'll get an error.
    I'm getting a different output Attachment 810623, the text copied from excel should look exactly like the top 3 items.

  19. #19
    Registered User
    Join Date
    05-22-2011
    Location
    Philippines
    MS-Off Ver
    Microsoft Office LTSC Professional Plus 2021
    Posts
    65

    Re: How to have this output and export to text file?

    that's correct

  20. #20
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: How to have this output and export to text file?

    I thought I saw spaces between A & B. There weren't. And I've only been drinking tea...

    =INPUT!A1&INPUT!B1&REPT(" ",25-LEN(INPUT!B1))&REPT(0,23-(LEN(100*INPUT!C1)+8))&100*INPUT!C1&18700003

  21. #21
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: How to have this output and export to text file?

    your attachment is invalid
    could you explain why there is different number of spaces?
    26, 21 and 24 ?
    this is Excel not Word so you have to be exact
    Last edited by sandy666; 12-24-2022 at 11:24 AM.

  22. #22
    Registered User
    Join Date
    05-22-2011
    Location
    Philippines
    MS-Off Ver
    Microsoft Office LTSC Professional Plus 2021
    Posts
    65

    Re: How to have this output and export to text file?

    Quote Originally Posted by Glenn Kennedy View Post
    I thought I saw spaces between A & B. There weren't. And I've only been drinking tea...

    =INPUT!A1&INPUT!B1&REPT(" ",25-LEN(INPUT!B1))&REPT(0,23-(LEN(100*INPUT!C1)+8))&100*INPUT!C1&18700003
    Sorry, I'm still not getting the right output (spacing) please see this Attachment 810625. Thank you.

  23. #23
    Registered User
    Join Date
    05-22-2011
    Location
    Philippines
    MS-Off Ver
    Microsoft Office LTSC Professional Plus 2021
    Posts
    65

    Re: How to have this output and export to text file?

    Quote Originally Posted by sandy666 View Post
    you attachment is invalid
    could you explain why there is different number of spaces?
    26, 21 and 24 ?
    this is Excel not Word so you have to be exact
    Kindly refer to this Attachment 810626. Thank you.

  24. #24
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: How to have this output and export to text file?

    your attachment:

    invalidattachment.png

    again

    read big yellow banner at the top of this page

  25. #25
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: How to have this output and export to text file?

    Sadly, my crystal ball is away for repair. If you don't TELL me the number of characters required (and preferably in Post 1) I can only guess.

    =INPUT!A1&INPUT!B1&REPT(" ",40-LEN(INPUT!B1))&REPT(0,23-(LEN(100*INPUT!C1)+8))&100*INPUT!C1&18700003

  26. #26
    Registered User
    Join Date
    05-22-2011
    Location
    Philippines
    MS-Off Ver
    Microsoft Office LTSC Professional Plus 2021
    Posts
    65

    Re: How to have this output and export to text file?

    Quote Originally Posted by Glenn Kennedy View Post
    Sadly, my crystal ball is away for repair. If you don't TELL me the number of characters required (and preferably in Post 1) I can only guess.

    =INPUT!A1&INPUT!B1&REPT(" ",40-LEN(INPUT!B1))&REPT(0,23-(LEN(100*INPUT!C1)+8))&100*INPUT!C1&18700003
    Sorry, I have posted the picture in first post (edited). To answer Numbers before Name (10 characters), Name (Max 40 characters and has no spaces to the numbers before it) and Numbers with zeroes(23 characters).

    I hope that clears everything up. Thank you.

  27. #27
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: How to have this output and export to text file?

    So. Is Post 25 OK, or not???

  28. #28
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: How to have this output and export to text file?

    you didn't answer on post#21

    and use @username because we don't know to whom you are talking

  29. #29
    Registered User
    Join Date
    05-22-2011
    Location
    Philippines
    MS-Off Ver
    Microsoft Office LTSC Professional Plus 2021
    Posts
    65

    Re: How to have this output and export to text file?

    Just tried that now, and it did the job! Thank you very much!

  30. #30
    Registered User
    Join Date
    05-22-2011
    Location
    Philippines
    MS-Off Ver
    Microsoft Office LTSC Professional Plus 2021
    Posts
    65

    Re: How to have this output and export to text file?

    Quote Originally Posted by Glenn Kennedy View Post
    Sadly, my crystal ball is away for repair. If you don't TELL me the number of characters required (and preferably in Post 1) I can only guess.

    =INPUT!A1&INPUT!B1&REPT(" ",40-LEN(INPUT!B1))&REPT(0,23-(LEN(100*INPUT!C1)+8))&100*INPUT!C1&18700003
    Just tried that now, and it did the job! Thank you very much!

  31. #31
    Registered User
    Join Date
    05-22-2011
    Location
    Philippines
    MS-Off Ver
    Microsoft Office LTSC Professional Plus 2021
    Posts
    65

    Re: How to have this output and export to text file?

    Quote Originally Posted by sandy666 View Post
    your attachment is invalid
    could you explain why there is different number of spaces?
    26, 21 and 24 ?
    this is Excel not Word so you have to be exact
    There were exact spaces because it is a requirement of a program where I will be importing the file. I have updated my first post. Thank you very much for your patience and assistance

  32. #32
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: How to have this output and export to text file?

    @kraddark
    sure but don't quote whole posts just use @username, that's enough

  33. #33
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: How to have this output and export to text file?

    Woo Hoo! We got there. Thanks for the feedback!

  34. #34
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: How to have this output and export to text file?

    additional solution with Power Query

    Please Login or Register  to view this content.
    as Glenn said you can use Copy/Paste into Notepad
    or
    save as text (.txt)
    but there will appear a few questions and you have to choose wise what you want to do

    so easer will be copy/paste

+ 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. Compare values and output cell titles, able to output multiple results
    By TMG2016 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 05-07-2016, 11:42 AM
  2. [SOLVED] Array to embed formula and if number of output is met output Blank
    By ywang in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-29-2015, 02:34 AM
  3. [SOLVED] Cell reference, output dates to numeric. Should output as text
    By lifeseeker1019 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-02-2015, 05:51 PM
  4. [SOLVED] Comparing two cells for similarities and output a third cell (if C1 = B1, then output A1)
    By PERFECT777 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-26-2013, 12:37 AM
  5. [SOLVED] Paste variable output (SQL Output) into a single cell.
    By fblaze in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-28-2013, 06:24 AM
  6. Looping through columns to copy output into other sheet, and saving output
    By eludlow in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-08-2009, 06:27 AM
  7. Importing several Output sheets into one consolidated Output Sheet
    By Ugh_Der in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-13-2009, 08:58 AM

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