Did you preserve the directory structure when you restored them?
Using the #EXTINF: lines you can just get the filenames:
Code:
sed '1d;/\\\\192\.168/d;s/^#EXTINF:0,//;/^$/d' test
311-11-Don't Stay Home.mp3
311-15-Love Song.mp3
The Academy is-05-Everything We Had.mp3
Using the lines you mentioned you can include the directories:
Code:
sed '/\\\\192.168.1.31\\/!d;s/^\\\\192\.168\.1\.31\\//' test
storage\250a\Music\311\311\311-11-Don't Stay Home.mp3
storage\250a\Music\311\Greatest Hits '93-'03\311-15-Love Song.mp3
storage\250a\Music\The Academy Is\Santi\The Academy is-05-Everything We Had.mp3
Forward slashes may be better:
Code:
sed '/\\\\192.168.1.31\\/!d;s/^\\\\192\.168\.1\.31\\//;s/\\/\//g' test
storage/250a/Music/311/311/311-11-Don't Stay Home.mp3
storage/250a/Music/311/Greatest Hits '93-'03/311-15-Love Song.mp3
storage/250a/Music/The Academy Is/Santi/The Academy is-05-Everything We Had.mp3
I think you may want to use the find command to create another list of the MP3s you managed to recover. Then use text tools to find similarities and differences.
For example:
To create a list of all of the mp3 files in the Music directory:
find ~/Music -type f -name "*.mp3" >mp3list
Suppose you saved a list from the first sed command as m3ulist:
cat m3ulist
311-11-Don't Stay Home.mp3
311-15-Love Song.mp3
The Academy is-05-Everything We Had.mp3
Now lets find items from the m3ulist that are in the mp3list:
grep -f m3ulist mp3list
If you sort the lists you can also use the diff or comm commands. Comm will print 3 columns. Uniq to file1; uniq to file2; common to both files. You can use either the -1, -2 or -3 option (or a combination) to turn off the respective column. So to list items missing from the m3u list:
comm -23 m3ulist mp3list
Remember that the lists need to be sorted.
Here is a little linux magic if they aren't:
comm -23 <(sort m3ulist) <(sort mp3list)
If you have a list of filenames, including the paths, you could use items in the list with the "file" command to analyze the file. If the first part of the file is corrupt, it may not be identified as an mp3 file. The file command examines the contents of the file. It does'nt rely on the filetype extension.
cat filelist | tr '\n' '\000' | xargs -0 -L 1000 file >mp3filecheck
The "tr" pipe & the corresponding "-0" xargs option are needed because of the spaces in the filenames. This won't guarantee that the file is OK, but if it is totally unplayable because the header info is whacked, that will probably show up.
Another way to do this if you have a short list is to redefine the IFS variable:
Code:
( IFS='
> '
> file $(cat list)
> )
2006_07_02_this WEEK in TECH - MP3 Edition_TWiT 60_ A Series of Tubes.mp3: Audio file with ID3 version 23.0 tag, MP3 encoding
2006_07_09_this WEEK in TECH - MP3 Edition_TWiT 61_ Cripes!.mp3: Audio file with ID3 version 23.0 tag, MP3 encoding
2006_07_31_this WEEK in TECH - MP3 Edition_TWiT 64_ Chaos Theory.mp3: Audio file with ID3 version 23.0 tag, MP3 encoding