First question is why not just supply an import file with the pages?
The Harder Way
This code has been altered as it was just for posts, so is not fully tested: so test on a local install!
If you use it then please do update the pastebin for others to use ??
https://digitalraindrops.pastebin.com/ayvGaLau
What the functions should do is read two files from the themes directory, one with categories the other with posts or pages
It will run once then set an option so it does not run every time.
Categories
$fileName = TEMPLATEPATH.'/demo-data/categories.txt';
The function in the link above requires a TAB seperated file, you could create an array in code.
Row 1 is the Headers Row two columns name and description
Posts or pages
$fileName = TEMPLATEPATH.'/demo-data/posts.txt';
The function in the link above requires a TAB seperated file, you could create an array in code.
Row 1 is the Headers Row Seven columns
type, title, content ,excerpt, status, categories, tags
type = post or page
status = true (published) blank or false for draft
categories = array comma seperated names
tags = array comma seperated names
I have not found where the template is set, it is likely in the post meta, someone else might add this??
HTH
David