Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#31 2010-08-25 19:52:15

Jaro
Member
From: S/F
Registered: 2004-11-18
Posts: 89

Re: jmd_csv: Batch-import articles from a CSV

Would it be difficult to modify the plugin to include keywords import?

Offline

#32 2010-08-25 20:04:02

Jaro
Member
From: S/F
Registered: 2004-11-18
Posts: 89

Re: jmd_csv: Batch-import articles from a CSV

Jaro wrote:

Would it be difficult to modify the plugin to include keywords import?

Nevermind. I just tried the import and the keywords are imported although it’s not mentioned in the plugin documentation. Great stuff!

Offline

#33 2010-08-25 23:31:43

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: jmd_csv: Batch-import articles from a CSV

I had a bunch of events that I brought in with jmd_csv. They all needed specific timestamps, which are currently unsupported, so here is my workaround.

  1. put a timestamp in an unused custom field then
  2. run this sql to replace the exiting timestamp with the new one.
UPDATE `textpattern` SET `Posted` = `custom_1`;
UPDATE `textpattern` SET `custom_1` = NULL;

worked pretty well.

Last edited by mrdale (2010-08-25 23:32:22)

Offline

#34 2010-11-02 03:25:46

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Re: jmd_csv: Batch-import articles from a CSV

with the Posted – I just commented out these line:

/* 
feed_time=now(),
Posted=now(),
LastMod=now(), 
*/

And added it to the csv headers – works perfectly :)

(apart from the fact that all my articles are to be to be posted in 2031 because I got the date wrong :) )

Offline

#35 2010-11-02 15:38:28

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: jmd_csv: Batch-import articles from a CSV

cool, can you post your csv header and one line just for the hell of it

Offline

#36 2010-11-03 00:25:51

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Re: jmd_csv: Batch-import articles from a CSV

Sure – Here you go

The format date is fixed on this one, I didn’t put a time stamp, but you can.

Let me know if it works.

Offline

#37 2011-02-03 18:59:40

paxrex33
Member
Registered: 2007-10-25
Posts: 15

Re: jmd_csv: Batch-import articles from a CSV

It didn’t work for me in the start. My csv file contains serbian specific latin characters. If the file is in ANSI format then the import breaks on the first serbian character. If it’s in UTF8 format the import simply does not work.
But when I saved it as UTF8 without BOM everything worked well.

Offline

#38 2011-08-26 11:37:05

Algaris
Member
From: England
Registered: 2006-01-27
Posts: 607

Re: jmd_csv: Batch-import articles from a CSV

This is a very useful plugin. It’s saved me having to input 375 events by hand.

One thing I did come across though is that jmd_csv doesn’t like things such as fancy quotes and apostrophes, em dashes and fraction symbols, etc. Is there anyway for the plugin to be able to support this? Alternatively does anyone know how to get Excel to convert these to ‘plain text’ when saving to a CSV spreadsheet?

Thanks.

Offline

#39 2012-01-26 02:58:42

blur
Member
Registered: 2008-09-08
Posts: 18

Re: jmd_csv: Batch-import articles from a CSV

Algaris wrote:

One thing I did come across though is that jmd_csv doesn’t like things such as fancy quotes and apostrophes, em dashes and fraction symbols, etc. Is there anyway for the plugin to be able to support this? Alternatively does anyone know how to get Excel to convert these to ‘plain text’ when saving to a CSV spreadsheet?

1. Download Notepad++
2. Save the CSV on excel
3. Open the CSV on Notepad++
4. Click on Encoding > Convert to UTF
5. Click on Encoding > Convert to UTF without BOM
6. Save and import on jmd_csv. Voila!

I notice that converting first to UTF and then to UTF without BOM keep the latin characters (áéíóúñ) on my fields and allow jmd_csv to make the insert on DB.

Last edited by blur (2012-01-26 03:01:56)

Offline

#40 2013-01-17 16:06:54

spiffin
Plugin Author
From: London, UK
Registered: 2004-06-08
Posts: 95
Website

Re: jmd_csv: Batch-import articles from a CSV

Just save me a ton of work — thank you!

Offline

#41 2013-01-17 16:18:52

Algaris
Member
From: England
Registered: 2006-01-27
Posts: 607

Re: jmd_csv: Batch-import articles from a CSV

I never did get around to saying thank you Blur. Your instructions have saved me a lot of time and effort.

Because it might be relevant to other people this is how I use jmd_csv

1. Create a file category, “jmd_csv”
2. Content>Files: Upload a file to the “jmd_csv” category
3. Extensions>jmd_csv: Click import

In the plugin I removed the code that dealt with the date/time posted and the url_title so that I could specify my own in the spreadsheet.

My header row looks something like this:

url_title, Posted, feed_time, Title, Body, Excerpt, Section, Category1, Category2, LastMod

The posted, feed_time and LastMod data use the same format as it is in the mySQL database for example, 2011-10-10 13:00:00. For the url_title I use a number such a 01, 02, etc. This saves me having to worry about articles which might have the same title.

Offline

Board footer

Powered by FluxBB