Dismiss Notice
You are browsing this site as a guest. It takes 2 minutes to CREATE AN ACCOUNT and less than 1 minute to LOGIN

Python Script: Organize Massive files with ease!

Discussion in 'Tech, Gadgets & Science Forum' started by HT, Aug 2, 2011.

  1. HT

    HT JF-Expert Member

    #1
    Aug 2, 2011
    Joined: Jul 29, 2011
    Messages: 1,899
    Likes Received: 3
    Trophy Points: 0
    Sometimes it happen you have many files you need to organize bt you cannot. I had 700+ files to organize into folders, something like:
    1.Unajibu Maombi album.mp3
    blah_blah2.pdf
    2.Unajibu Maombi album.mp3
    blah_blah3.pdf3.
    Unajibu Maombi album.mp3
    4.Unajibu Maombi album.mp3
    blah_blah1.pdf
    ......................
    Here script will nicely organize them for you
    Just change length of directory names in script and drop it in massive files.
    Post your modified version but observe that simple copyright (free except...)
    Enjoy, HT :A S-omg:
     

    Attached Files:

  2. HT

    HT JF-Expert Member

    #2
    Aug 2, 2011
    Joined: Jul 29, 2011
    Messages: 1,899
    Likes Received: 3
    Trophy Points: 0
    also if you have idea on improving, let me know!
     
  3. Chief-Mkwawa

    Chief-Mkwawa Platinum Member

    #3
    Aug 2, 2011
    Joined: May 25, 2011
    Messages: 14,027
    Likes Received: 2,854
    Trophy Points: 280
    ah mejaribu kawaida tu, kaka kwan we hujui kuzip file, through zip au rar waweza eka mafile mengi tu, tena kuna super compressor. Mfano game la gta san andreas lina 4.7 gb then linakua compressed hadi 600 mb. Au nipo op umemaanisha chengine?
     
  4. HT

    HT JF-Expert Member

    #4
    Aug 2, 2011
    Joined: Jul 29, 2011
    Messages: 1,899
    Likes Received: 3
    Trophy Points: 0
    ni kuorganize related files into folders not backup/compress. That is another thing alltogether
     
  5. v

    von Neumann Member

    #5
    Sep 16, 2013
    Joined: Sep 10, 2013
    Messages: 29
    Likes Received: 0
    Trophy Points: 3
    Kaka congrats kwa ubunifu wako.. mi pia nnajifinza pytho bado cjaimasta fresh naomba niulize kidogo hv inawezekana kutengeneza software complicate kidogo kama maybe kama media player yenye cutevisual interface kama button nzurinzuri na vnginevyo.. mtoa mada naomba unipe mwongozo katika hili...
     
  6. m

    mwandulu Member

    #6
    Mar 7, 2016
    Joined: Dec 22, 2012
    Messages: 23
    Likes Received: 2
    Trophy Points: 5
    A great solution for simple moves.
    Since you have said
    I had a question.
    Since your script does not check for similar copies nor file ownership rights, then one might hit a bump when running this code.
    How about using existing tools such as RSYNC.
    It is optimized for the job of moving resources huge and small also will take care of so many unknowns.
    I will post a solution shortly about rsync.

    Couple of things the python script did not take notice of are: duplicate files & rights, something else? forgot

    the code was well-organized.

    Regards,
     
  7. s

    stormryder JF-Expert Member

    #7
    Mar 10, 2016
    Joined: Mar 23, 2013
    Messages: 679
    Likes Received: 106
    Trophy Points: 60
    Blender, You tube ni mfano wa Python at work
     
  8. thesym

    thesym JF-Expert Member

    #8
    Mar 10, 2016
    Joined: Aug 15, 2012
    Messages: 1,632
    Likes Received: 1,189
    Trophy Points: 280
    Blender imetengenezwa kwa c++. Ila kwenye application zake mfano game developing ndo wanatumia python.
     
  9. s

    stormryder JF-Expert Member

    #9
    Mar 10, 2016
    Joined: Mar 23, 2013
    Messages: 679
    Likes Received: 106
    Trophy Points: 60
    Blender unapo istart huwa ina start python Interpreter, Pia kuna Scientific packages kama Anaconda, cannopy ni Python at work
     
  10. thesym

    thesym JF-Expert Member

    #10
    Mar 10, 2016
    Joined: Aug 15, 2012
    Messages: 1,632
    Likes Received: 1,189
    Trophy Points: 280
    Dev:Doc/FAQ - BlenderWiki
    ila Blender uses the Python programming language for its scripting API

    upload_2016-3-10_16-32-5.png
     
  11. s

    stormryder JF-Expert Member

    #11
    Mar 10, 2016
    Joined: Mar 23, 2013
    Messages: 679
    Likes Received: 106
    Trophy Points: 60
    C++ inatumika kuinterface python na System
     
  12. m

    mwandulu Member

    #12
    Mar 14, 2016
    Joined: Dec 22, 2012
    Messages: 23
    Likes Received: 2
    Trophy Points: 5
    Hello,
    samahani kwa kuchelewa sana kujibu.
    People hijacked this discussion already. Doh!!

    I have a lot of respect for the authors skills in crafting an elegant script Though, originally the author wrote the moving script using Python, i thought of just using existing tools and hence avoid re-inventing the wheel.

    Anyway my 2 cents contribution regarding moving files from one folder to another.
    If one needs a really specific task for rsnyc, i could craft it. Rsync is a big and is optimized for so many things, including slow networks.

    rsync - a fast, versatile, remote (and local) file-copying tool

    important point is try to use opetions 'n' and 'v' for beginners cause it helps to visualize. after confirming the code, remove the -n flag to proceed

    Code:
    rsync -nrv --delete-after /source /destination
    
    -n : --dry-run flag
    simply pretends the move happens but does not make any changes to the system.

    in case there is a limit to files need to be moved then command:
    --min-size=1.5m
    --max-size=1.2m

    Code:
    rsync -nrv --min-size=1.2m --max-size=1.5m --delete-after /source /destination
    
    --p flag to preserve permissions
    Code:
    rsync -nrv --p --delete-after /source /destination
    
    --append-verify flag
    this will perform a check some verification on the receiving side.
    Code:
    rsync -nrv --append-verify --delete-after /source /destination
    
    --ignore-exisiting
    flag ignores any files in the receiving
    Code:
    rsync -nrv --append-verify --delete-after /source /destination
    
    --exclude=PATTERN such as: txt;doc;java
    --include=PATTERN such as: text;doc;java
    Code:
    rsync -nrv --exclude=txt;odt --delete-after /source /destination
    
    Code below will only move text and OpenOffice document text files
    Code:
    rsync -nrv --include=txt;odt --delete-after /source /destination
    
     
Loading...