It would take a custom snippet, but a fairly simple one, depending on how the CSV file is formatted.
It would look something like this (note that you'd have to adjust the code to match the fields of the CSV file):
<?php
$resourcesCreated = 0;
$output = "";
if (($fp = fopen("test.csv", "r")) !== FALSE) {
while (($data = fgetcsv($fp, 1000, ",")) !== FALSE) {
if (count($data)) {
/* fields from CSV file */
$fields['pagetitle'] = $data[0];
$fields['introtext'] = $data[1];
$fields['content'] = $data[2];
//etc.
/* other fields (optional) */
$fields['published'] = '1';
$fields['hidemenu'] = '0';
$fields['parent'] = '0';
$fields['isfolder'] = '0';
// etc.
$response = $this->modx->runProcessor('resource/create', $fields);
if ($response->isError()) {
if ($response->hasFieldErrors()) {
$fieldErrors = $response->getAllErrors();
$errorMessage = implode("\n", $fieldErrors);
} else {
$errorMessage = 'An error occurred: ' . $response->getMessage();
$output .= "\n" . $errorMessage;
}
} else {
$resourcesCreated++;
/* you would only need this next section if you need to
* set TV values from the CSV file */
/*
$object = $response->getObject();
$resourceId = $object['id'];
$resource = $modx->getObject('modResource', $resourceId);
if ($resource) {
$resource->setTVValue('MyTV', $data[3]);
$resource->save();
}
*/
}
}
}
fclose($fp);
if (empty($output)) {
return 'Created ' . $resourcesCreated . ' resources';
} else {
return $output;
}
}