SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Member
    Join Date
    Nov 2005
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy How2 automate offline journal (multiple entries) to online blog?

    I'd like to upload/convert an offline journal/blog to an online blog. Problem is, all entries reside in a single text file that is several pages long. Each page has 6-8 different days/entries, with each entry may have 1-3 different topics/sub-entries). So I'm looking at roughly almost 300+ posts. The blog platform I'm using is WordPress. -I've posted this question in their support, but haven't gotten much response.

    So my big dilemma: How on earth can I avoid having to repeat the post-creation process about 300 times? For example, is there a utility that would automatically upload entries from a delimited text file? All entries are uniformly formatted by a line return and date while sub-entries are separated by the "+" sign.

    I've run several searches online (here, on google, etc) on this but came up with nothing tangible. So, I figured I'd ask here before finally committing myself to spending a looong time counting down from 300... Any insight would be appreciated!

    Thanks.
    Last edited by Geekette; Nov 21, 2005 at 15:17. Reason: typo

  2. #2
    SitePoint Evangelist LemoNade's Avatar
    Join Date
    Aug 2005
    Location
    Southampton, UK
    Posts
    500
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Could you possibly post a few lines from the text file so we can see the exact format. I'm sure it is possible to grab all the file data and separate each post into an array (normally by the explode() function.

    -Will

  3. #3
    SitePoint Addict kirikintha's Avatar
    Join Date
    Nov 2004
    Location
    Boulder, CO
    Posts
    290
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if your data is in a validated format ie. if everything is comman separated fine, then you have lots of options for taking that file and doing alot with it. I take dbfs files and import them into MS access, then spit them back out using myODBC to get them into MySQL.

    You can do the same, plus you get a couple of backups in theprocess in case enything goes awry.

    There are probably a lot of options available, but in my personal opinion taking the text file, importing it to an Access table, naming the fields and exporting it again to MySQL is very quick with just a little setup time using MyODBC

    can you give us a platform you are using for you web server so I can give you a better strategy?
    myspace.com/tarsus
    Technical Coordinator
    BCMT
    "Not impossible, just hard to do!"

  4. #4
    SitePoint Member
    Join Date
    Nov 2005
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi, Thanks for responses. I don't have MS Access but I my data format is flexible. I.e. if there is a script/utility/method that depends on tab delimiting instead of comma, I can edit to fit. BTW, if a php script is used, where would I initiate/run it from? My platform is the 1&1 basic package which includes mySQL, etc. if that helps.

    My entries currently reside in an MS Word file ordered by date, topic, link (if applicable) and commentary. Additional topics on same day separated by return/next line & preceded by "+". Next entry on different date separated by 2 lines. For Example:

    Aug27th- Who knew? Coffee will make you black; Researchers say caffeine has tanning effect: htp://.whodunit.bbc.uk/coffeeisevil.5679490.stm
    Does this mean more coffee in winter? Eitherway, Starbucks & co. are gonna love it...
    + Talk about multitalented; Putin to release rap CD: http://link2story (Additional topic on same day therefore preceded by delimiter of "+ ")


    Aug28th- Daylight time banned: www.ohSoConfused.com/article#

  5. #5
    SitePoint Enthusiast
    Join Date
    Nov 2005
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm - are parts of entry separated by some sign or sth ?

    You can use explode function but u need separator to separate the data.
    OOP Addict - sorry for my english

  6. #6
    SitePoint Addict kirikintha's Avatar
    Join Date
    Nov 2004
    Location
    Boulder, CO
    Posts
    290
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Null is right, you need to have a strategy to separate your pieces - it's hard to come up with a strategy, tab deliminating is fine, but it is time consuming if you don't have a way to import everything into a database schema - expecially since it looks like you have a lot of characters that could conflict with the importing process - so, you may need more than one deliminator to get the desired fields to populate the right fields in your database

    With phpMyadmin for mysql you can import text files into mysql - this is the fastest way I know of taking your data out - if you are using MSword, try and export all that to Excel (word puts a lot of extra junk that does not translate across platforms to the web) - then you take that file, and save it as a text file, then you can get your data uploaded. No matter what, it looks like you have to convert data - remember if you give all your different "posters" a primary key, you can reference that key and tie everthing together and get the data into the correct places in the end, even if you have like a bunch of text files numerically number from one to amillion, you can tie everything together in the end

    Sorry, I wish I had a better way of helping, I must admit to having alot of resources that makes this pretty easy for me, I've just never had to worry about it in the way you have - keep posting, we'll come up with an answer - try and get a little more descriptive in your posting as well, I'd like to a see a bit more of the data you are working with, I'll snag some of that and see if I can get it to work in a barebones manner!
    myspace.com/tarsus
    Technical Coordinator
    BCMT
    "Not impossible, just hard to do!"

  7. #7
    SitePoint Member
    Join Date
    Nov 2005
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, I've reformatted slightly and I reset delimiters with characters are not used anywhere else in the texts. I'm also concerned about ensuring that multiple posts within the same day do not get overwritten. This is what my data currently looks like:

    Return/empty line
    ~~~ (Delimiter for day)
    Post title
    Post Body
    +++ (Delimiter for additional post(s) on the same day)

    For example:

    ~~~
    Aug 12th, 2003
    Who knew? Coffee will make you black; Researchers say caffeine has tanning effect: htp://.whodunit.bbc.uk/coffeeisevil.5679490.stm
    Does this mean more coffee in winter? Eitherway, Starbucks & co. are gonna love it...
    +++
    Talk about multitalented; Putin to release rap CD: http://link2story

    ~~~
    Aug 28th, 2005
    Daylight savings time banned: www.ohSoConfused.com/article#
    <img src="http://mydomain.com/confusion.jpg" alt="confused ants" />


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
  •