Script to echo CSV data from XML file using PHP

Hello all

I have a very large XML file that lists high schools and other information about each school.

I have a WordPress network that runs a network for each state, then blogs/sites for each school of that state reside in their state’s network.

I have a plugin to mass clone/create these sites based on a template I’ve created using comma separated values. I am using Add Cloned Sites for WPMU (batch)

My problem is that I have over 20,000 of these school sites to make and the format to clone these sites, required by the plugin, is this: new_site_url, site_description, site_name

Here is one school line of information from my XML file:

ABC UNIFIED RICHARD GAHR HIGH SCHOOL LOS ANGELES COUNTY 11111 ARTESIA BLVD. 5629265566 CERRITOS CA 90703 1-Regular school 1-Currently operational 1933159 601620 2058 555 549 508 446 1087 971 9 662 353 812 201 602 24.5 84 3-High 9th Grade 12th Grade 33.8731 -118.097

It’s a crazy amount of information I don’t need.

So how can use a PHP (or maybe something else?) script to echo just the information I need?

For example, that school’s info above… I would want the script to take that and return this:

california/RICHARD GAHR HIGH SCHOOL, DSN-America – California –

RICHARD GAHR HIGH SCHOOL, RICHARD GAHR HIGH SCHOOL

Now obviously there is the concern of the white space in the URL field. Do you have any suggestions for me there as well?

It would be best if it could actually echo this instead:

california/richardgahrhighschool, DSN-America – California –

RICHARD GAHR HIGH SCHOOL, RICHARD GAHR HIGH SCHOOL

Tell me how I can clarify my end goal here so we’re on the same page if any of this didn’t make sense. I appreciate the help.

Thanks all