Page 1 of 2 12 Last
  1. #1
    Mask_of_winter's Avatar
    Join Date
    Feb 2009
    Location
    USA Eastern Time Zone (GMT -5/-4)
    Posts
    2,473
    Blog Entries
    1

    Removing Line breaks

    After spending hours manually removing line breaks and trying a bunch of find and replace tips for microsoft word that didn't work I have found the perfect tool.

    http://www.textfixer.com/tools/remove-line-breaks.php

    Writer for Just Insert Imagination and co-host of the Wild Die Podcast.
    Find me on G+ to get in on one-shots, check out my YouTube and Twitch channel and follow me on Twitter @Mask_of_Winter

  2. #2
    Removing line breaks is simple, for example Notepad++ does this in one command.

    The trick is usually to handle too little or too many spaces with new/end lines, and to preserve paragraphs (which Textfitter doesn't do, even if it says it does). Most texts and formats are different, so you need to tailor the tool used.

    And of course, the ultimate tool is regular expression. Complex of course, but somewhat simple (RTFM obligatory of course) just to remove line breaks. Any decent word processor (like LibreOffice) or text program (like Notepad++) handle regexp in search&replace. Some have more user friendly tools, more limited of course but for example again with Notepad++ its Edit menu has: change upper to lower case and vice versa, merge&joins lines with several options for handling non empty lines (like with spaces), removing spaces before and or after lines, etc. All with keyboard shortcut, to do this fast to the current or selected text.
    Last edited by Blacky; January 18th, 2014 at 16:36.

  3. #3
    I use that too. I think I saw it in a tut video for FG.
    I never claimed to be sane. Besides, it's more fun this way.

  4. #4
    Zeus's Avatar
    Join Date
    Mar 2009
    Location
    Olympus
    Posts
    2,656
    Blog Entries
    2
    Here's a handy one liner for Perl which will remove all line breaks from a file:

    Code:
    perl -p -i -e 's/\r\n$/\s/g' file1.txt
    Perl can use regular expressions, so it makes short work of such substitutions. In this case 's/\r\n$/\s/g' (which is the regular expression) breaks down as s/<search pattern>/<replacement pattern>/g <apply globally>.
    FG Project Development
    Next Project(s)*: Starfinder v1.2 Starship Combat

    Current Project:
    Starfinder v1.1 - Character Starships
    Completed Projects: Starfinder Ruleset v1.0, Starfinder Core Rulebook, Alien Archive, Paizo Pathfinder Official Theme, D&D 5E data updates
    * All fluid by nature and therefore subject to change.

  5. #5
    Mask_of_winter's Avatar
    Join Date
    Feb 2009
    Location
    USA Eastern Time Zone (GMT -5/-4)
    Posts
    2,473
    Blog Entries
    1
    Quote Originally Posted by Zeus View Post
    Here's a handy one liner for Perl which will remove all line breaks from a file:

    Code:
    perl -p -i -e 's/\r\n$/\s/g' file1.txt
    Perl can use regular expressions, so it makes short work of such substitutions. In this case 's/\r\n$/\s/g' (which is the regular expression) breaks down as s/<search pattern>/<replacement pattern>/g <apply globally>.
    Ok, sounds good but... how do I do that? copy that line in my document in microsoft word or notepad before I copy the text in it? Sorry, I'm too old for this tech stuff hehe

    Thanks for your patience and help!
    Writer for Just Insert Imagination and co-host of the Wild Die Podcast.
    Find me on G+ to get in on one-shots, check out my YouTube and Twitch channel and follow me on Twitter @Mask_of_Winter

  6. #6
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    18,878
    Blog Entries
    1
    you need to install perl.
    http://www.perl.org/

    Id try the notepad++ options as something with a more familiar feel...

    MoreCore - Generic Ruleset
    --- Projects ---
    Extensions | Tutorials | MoreCore | MoreCore Themes | Call of Cthulhu | Maelstrom | FG Con

  7. #7

    Join Date
    Jul 2010
    Location
    Vendsyssel (Denmark)
    Posts
    600
    Hey, that is a useful link to know about Mask of Winter. Thanks!

    Vires Animi

  8. #8
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Denver, Colorado, USA (for a bit)
    Posts
    23,534
    The link provided in the OP is useful.

    As mentioned above - Notepad++ does this in one command "Join Lines" which is CTRL+J. There are other very useful text formatting commands available under the "Edit" menu in Notepad++ too.


    FG Product Development status: Pathfinder Playtest Ruleset and add-ons: In development. Pathfinder Bestiary, Pathfinder Bestiary 2, Pathfinder Bestiary 3 (in store).

    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  9. #9
    Trenloe has this innate ability to make me feel like a complete idiot at times. It's mostly due to my own laziness, but still. I've been using Notepad++ for a while now and never knew about Ctrl+J or half of the options in the Edit menu...

    Thank you very much.
    I never claimed to be sane. Besides, it's more fun this way.

  10. #10
    CTRL+J is also partially supported within FG in the string field and formatted text field types. Currently, it only joins the current line to the following line, not the entire selection.

    Cheers,
    JPG

Thread Information

Users Browsing this Thread

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

Posting Permissions

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

Log in

Log in