highend wrote:And MovieFirsts.py contains... what?
Give a real world example with enough input data and the expected output (and expect XY to show a paperfolder afterwards)...
Okay, here is an example using files prefixed with "bernie3_first". These are "firsts" for my kid. If I search for bernie3_first in the 2009 directory using XYplorer, I get the list shown below. Then running my python against the 2009 directory, reduces it to a single match for each bernie3_first found, for files only. Essentially I'm trying to reduce the number of "bernie3_first" matches to a single match of that pattern, to increase readability.
XYplorer:
Z:\Family_Media\2009\Bernie3\Bernie3_First_Year_Home-03162009\Bernie3_First_Birthday
Z:\Family_Media\2009\Bernie3\Bernie3_First_Year_Home-03162009\Bernie3_First_Eagles_Game
Z:\Family_Media\2009\Bernie3\Bernie3_First_Year_Home-03162009\Bernie3_First_Halloween
Z:\Family_Media\2009\Bernie3\Bernie3_First_Year_Home-03162009
Z:\Family_Media\2009\Bernie3\Bernie3_First_Year_Home-03162009\Bernie3_First_Birthday\bernie3_first_birthday-01.mov
Z:\Family_Media\2009\Bernie3\Bernie3_First_Year_Home-03162009\Bernie3_First_Birthday\bernie3_first_birthday-02.mov
Z:\Family_Media\2009\Bernie3\Bernie3_First_Year_Home-03162009\Bernie3_First_Birthday\bernie3_first_birthday-03.mov
Z:\Family_Media\2009\Bernie3\Bernie3_First_Year_Home-03162009\Bernie3_First_Birthday\bernie3_first_birthday-04.mov
Z:\Family_Media\2009\Bernie3\Bernie3_First_Year_Home-03162009\Bernie3_First_Birthday\bernie3_first_birthday-05.mov
Z:\Family_Media\2009\Bernie3\Bernie3_First_Year_Home-03162009\Bernie3_First_Birthday\bernie3_first_birthday-06.mov
Z:\Family_Media\2009\Bernie3\Bernie3_First_Year_Home-03162009\Bernie3_First_Birthday\bernie3_first_birthday-07.mov
Z:\Family_Media\2009\Bernie3\Bernie3_First_Year_Home-03162009\bernie3_first_day_clapping.jpg
Z:\Family_Media\2009\Bernie3\Bernie3_First_Year_Home-03162009\bernie3_first_day_clapping.mov
Z:\Family_Media\2009\Bernie3\Bernie3_First_Year_Home-03162009\Bernie3_First_Eagles_Game\bernie3_first_eagles_game_falls_down.mov
Z:\Family_Media\2009\Bernie3\Bernie3_First_Year_Home-03162009\Bernie3_First_Halloween\bernie3_first_halloween-01.mov
Z:\Family_Media\2009\Bernie3\Bernie3_First_Year_Home-03162009\Bernie3_First_Halloween\bernie3_first_halloween-02.mov
Z:\Family_Media\2009\Bernie3\Bernie3_First_Year_Home-03162009\Bernie3_First_Halloween\bernie3_first_halloween-03.mov
Z:\Family_Media\2009\Bernie3\Bernie3_First_Year_Home-03162009\bernie3_first_plays_toys.mov
Z:\Family_Media\2009\Bernie3\Bernie3_First_Year_Home-03162009\bernie3_first_smile-041909.jpg
Z:\Family_Media\2009\Bernie3\Bernie3_First_Year_Home-03162009\bernie3_first_smile-041909.mov
Z:\Family_Media\2009\Bernie3\Bernie3_First_Year_Home-03162009\bernie3_first_typing-070509.mov
Z:\Family_Media\2009\Bernie3\Bernie3_First_Year_Home-03162009\bernie3_first_typing-070509.txt
My python script without parsing. Removes extensions:
Bernie3Firsts.py -f -d /mnt/ds418/Barton_Family_Media/Family_Media/2009
bernie3_first_typing-070509
bernie3_first_day_clapping
bernie3_first_typing-070509
bernie3_first_smile-041909
bernie3_first_day_clapping
bernie3_first_plays_toys
bernie3_first_smile-041909
bernie3_first_eagles_game_falls_down
bernie3_first_birthday-02
bernie3_first_birthday-01
bernie3_first_birthday-05
bernie3_first_birthday-03
bernie3_first_birthday-04
bernie3_first_birthday-06
bernie3_first_birthday-07
bernie3_first_halloween-02
bernie3_first_halloween-01
bernie3_first_halloween-03
My python script with sed, sort, and uniq:
Bernie3Firsts.py -f -d /mnt/ds418/Barton_Family_Media/Family_Media/2009 | sed 's/...$//' | sort | uniq
bernie3_first_birthday
bernie3_first_day_clapp
bernie3_first_eagles_game_falls_d
bernie3_first_halloween
bernie3_first_plays_t
bernie3_first_smile-041
bernie3_first_typing-070