title: WGET Multiple Lists To Corresponding Directories
body: <p>I'm using WGET with lists to download multiple files with custom names, and need everything to go into custom directories.</p>
  
  <p>What I'm starting with:
  Just over 1000 XML files, each with a unique name in a single folder eg. speaker1.xml, speaker2.xml, etc. with formatting inside.
  Sample:</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
  &lt;Audios&gt;
      &lt;Audio&gt;
          &lt;Title&gt;There is More&lt;/Title&gt;
          &lt;Url&gt;http://www.somewebsite.com/modules/mydownloads/visit.php?lid=22295&lt;/Url&gt;
          &lt;Speaker&gt;Man Speaking&lt;/Speaker&gt;
          &lt;Length&gt;36.85Mb&lt;/Length&gt;
          &lt;Status&gt;NOT_STARTED&lt;/Status&gt;
          &lt;isSelected&gt;false&lt;/isSelected&gt;
      &lt;/Audio&gt;
  &lt;/Audios&gt;
  </code></pre>
  
  <p>I need to parse all these files so that only the title remains, without it's spaces, with .mp3 extension, followed by the link.</p>
  
  <pre><code>ThereisMore.mp3
  http://www.somewebsite.com/modules/mydownloads/visit.php?lid=22295
  </code></pre>
  
  <p>I know how to use find/replace + RegEx for this, but only in an individual file.</p>
  
  <p>Would Grep/Sed be what I need for this? If so, how?</p>
  
  <p>Continuing with question 2,</p>
  
  <p>My end goal is to use this to download a speaker's full set of mp3s and give them proper names:</p>
  
  <pre><code>while read url; do read filename; wget -O $filename $url; done &lt; speaker1.xml
  </code></pre>
  
  <p>Now, I'm able to download all the links with custom names for a single file, but don't know how to accomplish this for multiple files.</p>
  
  <p>I'll need everything to be saved into individual directories, with the speaker (or more properly, xml file) as the delimiter.</p>
  
  <p>For example, processing speaker1.xml downloads all mp3 files for speaker1 to a directory called speaker1, the same for speaker2, 3, up to 1000+</p>
  
  <p>I could put each .xml into a corresponding directory using</p>
  
  <pre><code>find . -name "*.xml" -exec sh -c 'mkdir "${1%.*}" ; mv "$1" "${1%.*}" ' _ {} \;
  </code></pre>
  
  <p>If I go that route, how would I get wget to loop through each xml within every directory?</p>