Last active
July 6, 2017 10:13
-
-
Save adriaandens/4979399 to your computer and use it in GitHub Desktop.
A possible solution to the files.khleuven.be zip problem.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$p = $ARGV[0]; | |
foreach(`cd "$p"; ls`) { | |
chomp($_);/^(.*)\\([^\\]+)$/; | |
$m=$1;$f=$2;$m=~s/\\/\//g; | |
`cd "$p";mkdir -p "$m"`; | |
`cd "$p";mv "$_" "$m/$f"`; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
(kutzooi, description laat geen enters toe dus zet ik het maar in een comment)
BEFORE:
Filename: "OOAnalyse\Groepsopdracht\TemplatesOpdracht\problems+opportunities+objectives+constraints_matrix.doc" AFTER:
Filename: "problems+opportunities+objectives+constraints_matrix.doc" in the directory "OOAnalyse/Groepsopdracht/TemplatesOpdracht/"
USAGE:
copy this into an empty file, save it and run on the commandline as:
perl minified_khleuven_zip_problem.pl /absolute/path/to/files/with/such/a/structure
EXAMPLE: perl minified_khleuven_zip_problem.pl /Users/adri/Google\ Drive/Adriaan/School/Toegepaste\ Informatica/2de\ Bachelor/selected_files_2012104_14457
Tested on the pafox/OOAnalyse/ directory.