NB : Everything presented in the situation is totally fake and had just been put here to make the challenge a little more fun ;) ... Or maybe not ;)
=== === BEGINNING TRANSMISSION === ===
I recently had a disk failure. I hopefully had backups and I now want my photos back. However, EVERY backup looks corrupted in the parallel universe where I live. But that's not a problem, because we had special tools to help user find their files back. They work a little bit like yours, and looks around a disk for headers that look like images. As they are still in beta, the software recovers any image it finds, gives it a random name and outputs a list containing:
The model of the camera that took the photo, or a single
-if not available. Note that the model could contain spaces, but no
A tab char (
\t, ASCII 9)
The name of the photo file.
The file is a standard text file and looks like that:
[...] - uyfeiebsvH.jpg - hv754ce758.gif - 8321214736.jpg - FgnvsfHJBs.jpg - OMGILOVYOU.jpg - HElloDearH.png - umanHAYYSG.jpg COOLCAM S1332 umanIAYYSG.jpg iCell 7G 1234567890.jpg [...]
The file is quite big, and I can't rely on my little Ubro to move all the file that have a model in a separate directory.
Dear Human, I need your help. I want you to move all photos that have data about the camera in a separate directory, so I could find my little cute cat pictures out of this mess of icons, screenshots...
However, these backups are taking place on My LiquidStateDrive46X, so I don't have a lot of space left (and I'm actually downloading the Internet, so, you know, it's difficult to download something else while doing that. I just can barely surf the web and you are the only one I've found, human!)
Don't let me live that way ! Please, write my a small program that will do the work for me, and save a little Ubro.
As this is code-golf, the shortest program wins
I need to be able to launch you program, HUMAN ! So make sure your program has an existing interpreter.
You can expect the list file to be in the directory where I launch your script. It will be named ./list.txt
You need to move images to ./withmodel/
Every image recovered is in the same directory from where I launch your program
No image have a - in his name. Same goes for camera models
It need to be a real program, not a simple function.
No internet access, I'm DOWNLOADING! This is really important.
I need my cat images quickly, or I can't survive: This code-golf will end on the 10th of October, if I'm still alive on this day.
=== === END OF TRANSMISSION === ===