title: Bulk renaming of files by extracting characters between the first and second underscore in the filename
body: <p>I'm trying to bulk rename files in a folder with sed, rename or any other way in OSX. I'd like to retain a part of the file name that's between the first and second underscore. For example rename "JAS_9877_FF_0023.jpg" to "9877.jpg" and I need to do this for hundreds of files. </p>
  
  <p>Thanks,</p>
  
  <p>Z. </p>