Results 1 to 4 of 4

Thread: Make all text file content in one line if a space found

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    10,456
    Rep Power
    10
    Hi

    These are your sample files: https://i.postimg.cc/4xHH4FN2/Before...text-Lines.jpg
    Before and After Reduce text Lines.jpg

    I won’t use those for this demonstration. I prefer to use these reduced size files
    content in one line input reduced sample.txt https://app.box.com/s/grrxh1rl372pzp2exn6em00ovhj4qhih
    content in one line output reduced sample.txt https://app.box.com/s/mpyvgf4kj9q04szjtj0255cns24lbxos

    https://i.postimg.cc/yYdStNqH/Before...ced-sample.jpg

    Before and After Reduce text Lines reduced sample.jpg


    It may be advisable for you to repeat the things that I am doing for you for more parts of the full size text file




    So I have taken a look at your files, and done a macro for you ( Sub ReplaceInTextFileThreeCharacters__Space_vbCr_vbLf_ _WithA__Space__() )
    See here for full details: https://excelfox.com/forum/showthrea...ll=1#post16696

    Here the summary:
    _ It does not appear that you have any tab characters in your text file
    _ It seems that your text file uses the typical line separator of the two character pair, a carriage return and a line feed, ( In VBA coding, vbCr & vbLf )
    _ It seems that a single space precedes the new line characters that you wish to remove

    So..
    _ The macro that I have done for you, ( Sub ReplaceInTextFileThreeCharacters__Space_vbCr_vbLf_ _WithA__Space__() ) , replaces the three character combination of a space and a carriage return and a line feed, with a single space.
    ( In the given VBA coding I replace the three character combination of " " & vbCr & vbLf with a single space " " )
    It appears to give you the results you want


    Alan






    P.S.
    Please note , susan santa 12345 et al
    _ You have a number of accounts here and at other forums. Some of your posts have been deleted and/ or your accounts banned.
    _ I expect your posts have been deleted and/ or your account banned, because of two main reasons:
    _1) You often post poorly explained questions
    _2) Often when you get help you do not give any feedback, or you do not reply. This is very uncourteous and disrespectful to the people who voluntarily give their time to help you.
    And we don't know whether or not we are wasting our time helping you because we have no reply or feedback from you.

    _ This is not the first time that I have said all this, or similar, to you.

    I appreciate that you may not understand too well the English language, and I am much more reluctant to ban people than most forum Moderators are. But if you do not improve your posting style , I will delete you and your accounts in the future.

    It is your right on a free forum to post as you choose. But if you want to continue posting in the style that you have so far, then it is probably best for you to post at the larger forums such as mrexcel.com and excelforum.com. At excelfox.com we only have a small select number of answering members, and we do not like wasting our time on people who just want a quick service to get their work done for them.
    At excelfox we are interested in helping with problems, promoting, discussing, and learning office applications, not just giving a free coding writing service.

    Seriously no hard feelings intended, , I am just telling you it as it is.

    Alan
    Last edited by DocAElstein; 09-17-2022 at 03:35 PM.
    ….If you are my competitor, I will try all I can to beat you. But if I do, I will not belittle you. I will Salute you, because without you, I am nothing.
    If you are my enemy, we will try to kick the fucking shit out of you…..
    Winston Churchill, 1939
    Save your Forum..._
    KILL A MODERATOR!!

Similar Threads

  1. VBA Range.Insert Method: Code line makes a space to put new range in
    By DocAElstein in forum Familiar with Commands and Formulas
    Replies: 9
    Last Post: 01-24-2018, 08:54 PM
  2. Replies: 2
    Last Post: 11-27-2014, 07:52 AM
  3. Replies: 6
    Last Post: 06-01-2013, 03:24 PM
  4. Make Text to Numbers Code More User Friendly
    By mrmmickle1 in forum Excel Help
    Replies: 10
    Last Post: 11-20-2012, 06:19 PM
  5. Excel found unreadable content
    By zyousafi in forum Excel Help
    Replies: 2
    Last Post: 08-08-2012, 10:41 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •