title: Using sed with delimiters similar to cut
body: <p>Given a file <code>foo.txt</code> containing file names such as:</p>
  
  <pre><code>2015_275_14_1,Siboney_by_The_Tailor_Maids
  2015_275_16_1,Louis_Armstrong_Cant_Give_You_Anything_But_Love
  2015_275_17_1,Benny_Goodman_Trio_Nice_Work_Avalon
  2015_275_18_1,Feather_On_Jazz_Jazz_In_The_Concert_Hall
  2015_235_1_1,Integration_Report_1
  2015_273_2_1_1,Cab_Calloway_Home_Movie_1
  2015_273_2_2_1,Cab_Calloway_Home_Movie_2
  </code></pre>
  
  <p>I want to replace the <code>_</code> in the part before the comma with <code>.</code> and the <code>_</code> in the second part after the comma with a space.</p>
  
  <p>I can accomplish each individually with:</p>
  
  <pre><code>sed -E -i '' 's/([0-9]{4})_([0-9]{3})_([0-9]{2})_([0-9])/\1.\2.\3.\4./'
  </code></pre>
  
  <p>for the first part, and the second part then with:</p>
  
  <pre><code>sed -E -i '' "s/_/ /g"
  </code></pre>
  
  <p>But I was hoping to accomplish it in an easier fashion by using cut with sed but that doesn't work:</p>
  
  <p><code>cut -d "," -f 1 foo.txt | sed -E -i '' "s/_/./g" foo.txt &amp;&amp; cut -d "," -f 2 foo.txt | sed -E -i '' "s/_/ /g" foo.txt</code></p>
  
  <p>No good.</p>
  
  <p>So, is there a way to accomplish this with <code>sed</code> or maybe <code>awk</code> or maybe something else where I'm treating the <code>,</code> as  a delimiter such as in <code>cut</code>?  </p>
  
  <p>Desired output:</p>
  
  <pre><code>2015.275.14.1,Siboney by The Tailor Maids
  </code></pre>