Skip to main content
added 179 characters in body
Source Link

I would like to wget a list of items that I'm retrieving from an XML file. I'm using sed to clean up the XML, and I'm ending up with output like this:

CountofMonteCristo.zip
English.
http://www.archive.org/download/count_monte_cristo_0711_librivox/count_monte_cristo_0711_librivox_64kb_mp3.zip
Alexandre.
Dumas.
LettersofTwoBrides.zip
English.
http://www.archive.org/download/letters_brides_0709_librivox/letters_brides_0709_librivox_64kb_mp3.zip
Honoréde.
Balzac.
BleakHouse.zip
English.
http://www.archive.org/download/bleak_house_cl_librivox/bleak_house_cl_librivox_64kb_mp3.zip
Charles.
Dickens.

I'd like to use wget -i to download these files as Language.Lastname.Firstname.Title.zip

I'm open to re-arranging the file somehow so that I can use $filename $url

I've tried a few different sed commands. Sed is what I've used to clean up the XML tags, but I can't figure out how to move text to the appropriate place. The titles, names, and languages will vary for each file.

EDIT: Before cleaning up the tags with sed, each line is wrapped in tags, such as English and FileTitle. I think this could be helpful in identifying patterns to re-arrange things.

EDIT2: Here's the XML source

EDIT3: Something like this looks like it would work, but I'm having trouble modifying it to suit my needs.

My ultimate goal is to organize all of the files into folders, with a hierarchy of Language -> AuthorLastnameFirstname -> Files.zip

If what I'm doing is not best practice, I'm open to other methods.

Thanks

I would like to wget a list of items that I'm retrieving from an XML file. I'm using sed to clean up the XML, and I'm ending up with output like this:

CountofMonteCristo.zip
English.
http://www.archive.org/download/count_monte_cristo_0711_librivox/count_monte_cristo_0711_librivox_64kb_mp3.zip
Alexandre.
Dumas.
LettersofTwoBrides.zip
English.
http://www.archive.org/download/letters_brides_0709_librivox/letters_brides_0709_librivox_64kb_mp3.zip
Honoréde.
Balzac.
BleakHouse.zip
English.
http://www.archive.org/download/bleak_house_cl_librivox/bleak_house_cl_librivox_64kb_mp3.zip
Charles.
Dickens.

I'd like to use wget -i to download these files as Language.Lastname.Firstname.Title.zip

I'm open to re-arranging the file somehow so that I can use $filename $url

I've tried a few different sed commands. Sed is what I've used to clean up the XML tags, but I can't figure out how to move text to the appropriate place. The titles, names, and languages will vary for each file.

EDIT: Before cleaning up the tags with sed, each line is wrapped in tags, such as English and FileTitle. I think this could be helpful in identifying patterns to re-arrange things.

EDIT2: Here's the XML source

My ultimate goal is to organize all of the files into folders, with a hierarchy of Language -> AuthorLastnameFirstname -> Files.zip

If what I'm doing is not best practice, I'm open to other methods.

Thanks

I would like to wget a list of items that I'm retrieving from an XML file. I'm using sed to clean up the XML, and I'm ending up with output like this:

CountofMonteCristo.zip
English.
http://www.archive.org/download/count_monte_cristo_0711_librivox/count_monte_cristo_0711_librivox_64kb_mp3.zip
Alexandre.
Dumas.
LettersofTwoBrides.zip
English.
http://www.archive.org/download/letters_brides_0709_librivox/letters_brides_0709_librivox_64kb_mp3.zip
Honoréde.
Balzac.
BleakHouse.zip
English.
http://www.archive.org/download/bleak_house_cl_librivox/bleak_house_cl_librivox_64kb_mp3.zip
Charles.
Dickens.

I'd like to use wget -i to download these files as Language.Lastname.Firstname.Title.zip

I'm open to re-arranging the file somehow so that I can use $filename $url

I've tried a few different sed commands. Sed is what I've used to clean up the XML tags, but I can't figure out how to move text to the appropriate place. The titles, names, and languages will vary for each file.

EDIT: Before cleaning up the tags with sed, each line is wrapped in tags, such as English and FileTitle. I think this could be helpful in identifying patterns to re-arrange things.

EDIT2: Here's the XML source

EDIT3: Something like this looks like it would work, but I'm having trouble modifying it to suit my needs.

My ultimate goal is to organize all of the files into folders, with a hierarchy of Language -> AuthorLastnameFirstname -> Files.zip

If what I'm doing is not best practice, I'm open to other methods.

Thanks

Made things much more clear.
Source Link

I would like to wget a list of items that I'm retrieving from an XML file. I'm using sed to clean up the XML, and I'm ending up with output like this:

FileTitleCountofMonteCristo.zip
English.
http://urltofilewww.comarchive.org/file123abcdownload/count_monte_cristo_0711_librivox/count_monte_cristo_0711_librivox_64kb_mp3.zip
English
JasonAlexandre.
McalahanDumas.
SecondFileTitleLettersofTwoBrides.zip
English.
http://urltofilewww.comarchive.org/file456defdownload/letters_brides_0709_librivox/letters_brides_0709_librivox_64kb_mp3.zip
Honoréde.
Balzac.
BleakHouse.zip
English.
Markhttp://www.archive.org/download/bleak_house_cl_librivox/bleak_house_cl_librivox_64kb_mp3.zip
JohnsonCharles.
Dickens.

I'd like to use wget -i to download these files as EnglishLanguage.Lastname.Firstname.Title.zip

I'm open to re-arranging the file somehow so that I can use $filename $url

I've tried a few different sed commands. Sed is what I've used to clean up the XML tags, but I can't figure out how to move text to the appropriate place. The titles, names, and languages will vary for each file.

EDIT: Before cleaning up the tags with sed, each line is wrapped in tags, such as English and FileTitle. I think this could be helpful in identifying patterns to re-arrange things.

EDIT2: Here's the XML source

My ultimate goal is to organize all of the files into folders, with a hierarchy of Language -> AuthorLastnameFirstname -> Files.zip

If what I'm doing is not best practice, I'm open to other methods.

Thanks

I would like to wget a list of items that I'm retrieving from an XML file. I'm using sed to clean up the XML, and I'm ending up with output like this:

FileTitle.zip
http://urltofile.com/file123abc.zip
English
Jason
Mcalahan
SecondFileTitle.zip
http://urltofile.com/file456def.zip
English
Mark
Johnson

I'd like to use wget -i to download these files as English.Lastname.Firstname.Title.zip

I'm open to re-arranging the file somehow so that I can use $filename $url

I've tried a few different sed commands. Sed is what I've used to clean up the XML tags, but I can't figure out how to move text to the appropriate place. The titles, names, and languages will vary for each file.

EDIT: Before cleaning up the tags with sed, each line is wrapped in tags, such as English and FileTitle. I think this could be helpful in identifying patterns to re-arrange things.

EDIT2: Here's the XML source

My ultimate goal is to organize all of the files into folders, with a hierarchy of Language -> AuthorLastnameFirstname -> Files.zip

If what I'm doing is not best practice, I'm open to other methods.

Thanks

I would like to wget a list of items that I'm retrieving from an XML file. I'm using sed to clean up the XML, and I'm ending up with output like this:

CountofMonteCristo.zip
English.
http://www.archive.org/download/count_monte_cristo_0711_librivox/count_monte_cristo_0711_librivox_64kb_mp3.zip
Alexandre.
Dumas.
LettersofTwoBrides.zip
English.
http://www.archive.org/download/letters_brides_0709_librivox/letters_brides_0709_librivox_64kb_mp3.zip
Honoréde.
Balzac.
BleakHouse.zip
English.
http://www.archive.org/download/bleak_house_cl_librivox/bleak_house_cl_librivox_64kb_mp3.zip
Charles.
Dickens.

I'd like to use wget -i to download these files as Language.Lastname.Firstname.Title.zip

I'm open to re-arranging the file somehow so that I can use $filename $url

I've tried a few different sed commands. Sed is what I've used to clean up the XML tags, but I can't figure out how to move text to the appropriate place. The titles, names, and languages will vary for each file.

EDIT: Before cleaning up the tags with sed, each line is wrapped in tags, such as English and FileTitle. I think this could be helpful in identifying patterns to re-arrange things.

EDIT2: Here's the XML source

My ultimate goal is to organize all of the files into folders, with a hierarchy of Language -> AuthorLastnameFirstname -> Files.zip

If what I'm doing is not best practice, I'm open to other methods.

Thanks

added 143 characters in body
Source Link

I would like to wget a list of items that I'm retrieving from an XML file. I'm using sed to clean up the XML, and I'm ending up with output like this:

FileTitle.zip
http://urltofile.com/file123abc.zip
English
Jason
Mcalahan
SecondFileTitle.zip
http://urltofile.com/file456def.zip
English
Mark
Johnson

I'd like to use wget -i to download these files as English.Lastname.Firstname.Title.zip

I'm open to re-arranging the file somehow so that I can use $filename $url

I've tried a few different sed commands. Sed is what I've used to clean up the XML tags, but I can't figure out how to move text to the appropriate place. The titles, names, and languages will vary for each file.

EDIT: Before cleaning up the tags with sed, each line is wrapped in tags, such as English and FileTitle. I think this could be helpful in identifying patterns to re-arrange things.

EDIT2: Here's the XML source

My ultimate goal is to organize all of the files into folders, with a hierarchy of Language -> AuthorLastnameFirstname -> Files.zip

If what I'm doing is not best practice, I'm open to other methods.

Thanks

I would like to wget a list of items that I'm retrieving from an XML file. I'm using sed to clean up the XML, and I'm ending up with output like this:

FileTitle.zip
http://urltofile.com/file123abc.zip
English
Jason
Mcalahan
SecondFileTitle.zip
http://urltofile.com/file456def.zip
English
Mark
Johnson

I'd like to use wget -i to download these files as English.Lastname.Firstname.Title.zip

I'm open to re-arranging the file somehow so that I can use $filename $url

I've tried a few different sed commands. Sed is what I've used to clean up the XML tags, but I can't figure out how to move text to the appropriate place. The titles, names, and languages will vary for each file.

EDIT: Before cleaning up the tags with sed, each line is wrapped in tags, such as English and FileTitle. I think this could be helpful in identifying patterns to re-arrange things.

My ultimate goal is to organize all of the files into folders, with a hierarchy of Language -> AuthorLastnameFirstname -> Files.zip

If what I'm doing is not best practice, I'm open to other methods.

Thanks

I would like to wget a list of items that I'm retrieving from an XML file. I'm using sed to clean up the XML, and I'm ending up with output like this:

FileTitle.zip
http://urltofile.com/file123abc.zip
English
Jason
Mcalahan
SecondFileTitle.zip
http://urltofile.com/file456def.zip
English
Mark
Johnson

I'd like to use wget -i to download these files as English.Lastname.Firstname.Title.zip

I'm open to re-arranging the file somehow so that I can use $filename $url

I've tried a few different sed commands. Sed is what I've used to clean up the XML tags, but I can't figure out how to move text to the appropriate place. The titles, names, and languages will vary for each file.

EDIT: Before cleaning up the tags with sed, each line is wrapped in tags, such as English and FileTitle. I think this could be helpful in identifying patterns to re-arrange things.

EDIT2: Here's the XML source

My ultimate goal is to organize all of the files into folders, with a hierarchy of Language -> AuthorLastnameFirstname -> Files.zip

If what I'm doing is not best practice, I'm open to other methods.

Thanks

Source Link
Loading