1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Simple Question on Arranging Text - Help Appreciated

Discussion in 'Black Hat SEO' started by Micallef, Jul 25, 2010.

  1. Micallef

    Micallef Supreme Member

    Joined:
    Apr 29, 2009
    Messages:
    1,345
    Likes Received:
    1,221
    Occupation:
    SE Manipulator
    Location:
    London, UK
    Home Page:
    I need to find a quick way to organize a large body of text into a .txt file which displays sentences line by line. This is so it can be used by my random comment generator script.

    Example:

    "This is the first sentence. This is the second sentence. This is the third sentence."

    would become:

    This is the first sentence.
    This is the second sentence.
    This is the third sentence.

    It seems so simple but it's not! I have tried several possible ways without success.

    Can anyone offer up a solution? Will award +3 rep for the best solution.

    Thanks for reading.

    Micallef
     
  2. theStranger

    theStranger Newbie

    Joined:
    Jul 18, 2010
    Messages:
    18
    Likes Received:
    4
    You could slap together a program to do this pretty easily if you know a little programming.
     
  3. aftershock2020

    aftershock2020 Senior Member

    Joined:
    Oct 19, 2007
    Messages:
    981
    Likes Received:
    477
    Use php to create the file, as it will allow you to write into it and output whatever you want as the resulting data. The only downside to using .txt files is that they are one of the most unsecure access points in a website security loop. They can be found with a simple search of " domainname.whatever + .txt " in any search engine.

    If you use this method, be sure and lock them in a protected folder, only accessing them from a script call.

    To find how it works, simply search google for " writing text files with php " and it will direct you to a ton of tutorials.
     
    • Thanks Thanks x 1
  4. 7878

    7878 Executive VIP Premium Member

    Joined:
    Jun 14, 2009
    Messages:
    1,382
    Likes Received:
    7,864
    I sent you some info about a nifty Perl script that does this - but here's a link to a demo of another free tool to do the same thing:

    Code:
    http://text0.mib.man.ac.uk:8080/scottpiao/sent_detector
    And Wiki links to 4 or 5 free open source scripts here:

    Code:
    http://en.wikipedia.org/wiki/Sentence_boundary_disambiguation
    Good luck. :)
     
    • Thanks Thanks x 1
  5. Micallef

    Micallef Supreme Member

    Joined:
    Apr 29, 2009
    Messages:
    1,345
    Likes Received:
    1,221
    Occupation:
    SE Manipulator
    Location:
    London, UK
    Home Page:
    Thankyou for the replies. I have found a solution :)