• Greetings all,
    i’ve got a slight conundrum as i have a data feed where the file is only available in a tab-delimited text file format which automatically gets ftp’ed to a folder on my server every night.

    i want to be able to parse that file (which could contain several hundred records) and make them into posts.

    Is there any plugin out there for this already?
    Is there a good way to go about doing it?
    Am i crazy for thinking this is possible w/o crashing the server nightly?

    Thanks for any help pointing me in the right direction…

Viewing 3 replies - 1 through 3 (of 3 total)
  • Here is a plugin that creates posts from a CSV file
    http://wordpress.org/extend/plugins/csv-importer/

    You would need to run a script that converted the file you receive each night into another file in the format this plugin requires to create posts. That should be pretty doable. The plugin needs to be started manually but it shouldn’t be too difficult to convert it into a PHP file that could be run from a CRON job each night.

    Thread Starter famousb

    (@famousb)

    Thank you for the response.
    I have found a few options if i’m willing to do the conversion, but i was hoping to be able to avoid doing that.
    i know i could change the file programatically, but if i’m going to do that, i might as well modify the plugin to import the tab file myself by doing something like:

    $fcontents = file('./file.tab');
    for($i=0; $i<sizeof($fcontents); $i++) {
    $line = trim($fcontents[$i]);
    $arr = explode("\t", $line);
    #if your data is comma separated
    # instead of tab separated,
    # change the '\t' above to ';'
    $sql = "insert into...

    but i was hoping to avoid that…

    but even then i would need to do a CRON job…
    i was just hoping someone knew a plugin that already had it done (i’m lazy), so i could just put in the path and set the time for it to run the import.

    Thanks!

    contact the author of CSV TO POST he’s good with this stuff and gets back to you quickly.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Import from tab-delimited text file’ is closed to new replies.