General :: Scripting To Move Thousands Of Files Into Folders
May 25, 2011
Our client has a website (Joomla 1.5 based) to promote participation in and report results of a 10k race for runners in Scandinavia...
The race is scheduled for late June and will be covered by at least 5 still photographers at various points along the race course.
There are to be about 5,000 runners, each entered under a shirt number like bib_1000 through bib_5999, and this means there will be a significant number of digital jpg files submitted by the photographers...
The client has in place some software which will "automagically" resize, watermark, and rename the individual files in the form:
And so on with a possibility of as many as 10 or 12 images in the aggregate with the same alpha-numeric "shirt number" at the beginning of the filename.
Our presentation software does a great job of handling thumbnail image generation and displaying a slideshow in a lightbox of all files within a given folder on the webserver.
And now finally the question...
Given a folder containing 25,000 or so *.jpg files, how can we write a script that:
1. parses the filenames to unique "shirt numbers"
2. makes folders with each "shirt number" as the foldername
3. moves the files from the root of the original folder into the appropriate "shirt number" folder.
Note that the order of my list above is not important, and if you know of a better way to organize the task we are fine with that.
View 12 Replies
ADVERTISEMENT
Jan 25, 2011
Unix - In Linux, how do I move all files and folders into a new directory?
View 4 Replies
View Related
Nov 16, 2010
Terribly new to Linux and find it mindboggling. I work on brain imaging and unfortunately all of the analysis runs on Linux, and I do not understand computers well coming as I do from a medical background. So my question - There are various folders of patient MRI scans (folders called P1, P2, P3 etc) and within them are enclosed certain files that I am interested in (always called the same name in all folders, say image001). I would like a script that enables me to copy and move this image001 in all these individual folders to another folder altogether.
View 13 Replies
View Related
Dec 2, 2010
I am looking for a script/advice or guidance on how to write a script so that when I use the 'del' command it removes/sends the files/folders to a I specify for example 'dustbin
View 13 Replies
View Related
Jun 27, 2010
Is it possible to move multiple files and folders at once in terminal?
View 5 Replies
View Related
Aug 20, 2010
I've got a folder called Foo. In foo, there are 20 folders called bar1, bar2, bar3,...,bar20. In each of those barXX folders there are 2 files. How can i move those 2 files up one level into Foo with one command?
View 9 Replies
View Related
Nov 20, 2010
I dual boot a computer from separate hard drives in Windows XP and Ubuntu 10.04. Here is the deal: On my windows drive I have a folder that is filled with folders inside folders packed full of files in all the folders. There is a 100% possibility that I have multiple copies of any file in multiple locations. Is there any nice command or program to move all the files in all the folders to one central folder and in any way get rid of the multiple copies? Also, how do I compare to files that may or may not have the same name, but otherwise be identical to see if they are identical?
View 9 Replies
View Related
Jan 10, 2011
I'm sure I've done this before and am having a brain fart.
I have run into this a couple of time this last month:
I have a list of torrent files (blahblahhexblah.torrent) saved in a text file. I would like to read the text file and populate the client directory.
I can echo the file using:
But I cannot remember how to pipe the output into the directory, nor can I find any resources that describe the process.
Interestingly enough, I've had a couple of opportunities to do similar tasks with passwords and privileges and even across the LAN in the last few days. Solving this problem will help me solve the others for next time.
View 2 Replies
View Related
Nov 24, 2010
10.10 on a ext4 partition. I deleted a folder that sat on a NTFS partition that I use as data storage. I note that if I delete folders or files on this NTFS partition there is not the option to move to waste basket - it is just deleted. If the folder still exists on the hard drive (has not been over written) I may be able to retrieve it - but where could it be? On the NTFS partition?
View 2 Replies
View Related
Oct 3, 2010
Many years ago, I converted a portion of my files to an arbitrary format with a specific extension. i no longer desire to have them in this format and i would like begin the process of replacing them because conversion is not an appropriate solution. unfortunately, they are mixed in separate folders of the same root folder with files in my current format of a different extension. I feel it would make this process easier if I were to move every folder that contained a file with the undesired format to a separate root folder. The files are stored on a Linux server and shared via samba. How can I do this with a couple of commands or a script? I am open to other suggestions as well. I want to avoid time spent editing text files. Ultimately, I'd like a command that produced a list of full paths for folders, sorted by the number of levels would be a nice touch. A list of all of the files is clearly not what I'm looking for.
View 2 Replies
View Related
Jan 22, 2010
I record my lectures at school using my mobile phone then send them over wifi to my laptop and use a program to do volume correction all in windows. However, I want a exact copy of that folder in my home folder on my ubuntu install on a separate partition.I've been manually copying them over so far but I want to make a script that I can run to copy all new files over. I know a little bit about scripting, mounting the drive and actually copying files is easy, its figuring out how to determine new files and copy only those that I don't know how to do.
View 4 Replies
View Related
Sep 12, 2011
Whenever you write a program that prints its own process ID, I've always (without any exception) received numbers ranging in the tens of thousands. Never less, never higher. I was just wondering, why is are the process ID #s so high? Are the ones below it all system-related processes? And then when I run the program again, it prints out an ID that is several hundred above the previous execution... what happens between these two executions that come right after each other?
View 1 Replies
View Related
Feb 8, 2010
I need to know is there any way to record or tracking or make logging if when user samba delete files or folders i can know that, cause sometimeon samba server some users complain they lost files, though i have daily backup and i can restore their files, i just want to know if or maybe some other users in one group accidentally move or delete the files.
View 1 Replies
View Related
Sep 21, 2010
I am running an application called QuantiSNP [URL]. The binary file is "quantisnp2", called upon in the "run_quantisnp2.sh" supplied by the authors. I am only able to run the application for single file processing (e.g. 1 input file for 1 sample; I can't run the batch file processing because I don't have the necessary BeadStudio report files, which has different formatting for the input files).
The difficulty is that I have 300 samples (300 unique sample IDs) and 3 input files for each sample for a total of 900 runs of this application. I am wondering how would I be able to automate this process as a shell script instead of basically manually changing the sample ID and respective input files every time a run completes? I bolded the single file processing shell script command line options below that need to be changed for each sample/input single file processing run. The command line option "--sampleid" is for the name given to the processed output files corresponding to the sample of interest and there are 3 input files for each sample.
/home2/jason/QuantiSNP/quantisnp/linux64/run_quantisnp2.sh /home2/jason/QuantiSNP/MCR/v79/ --config /home2/jason/QuantiSNP/quantisnp/config/params.dat --levels /home2/jason/QuantiSNP/quantisnp/config/levels-affy.dat --outdir /home2/jason/QuantiSNP/quantisnp_out/ --sampleid sample1 --gender female --input-files /home2/jason/files/sample1_input.txt
Note that each sample has 3 input files, for a total of 3 runs of "quantisnp2" for each sample. e.g.
SAMPLEID INFILE
sample1 /home2/jason/files/sample1_input.txt
sample1 /home2/jason/files/sample1_input2.txt
sample1 /home2/jason/files/sample1_input3.txt
[code]....
View 7 Replies
View Related
Jul 29, 2010
what command is to be used to call strings from other files to the script and then comparing strings from two different files in the script to check if strings are matched then return the result to another script.
View 1 Replies
View Related
Aug 25, 2009
How can you create a script to move or copy files from a main directory into multiple directories below the main directory.
View 7 Replies
View Related
May 7, 2011
1. Every Sunday2. Find all files older than 1 day3. Gzip these file4. Tar up the gzipped files into one tar file.5. Name the tarball with a date stamp indicating what day it was created, so we know that week's files are in the file
View 3 Replies
View Related
Aug 18, 2009
Being relatively new both to Linux and this forum, i am sorry if i make a post that already is, evn though i couldn`t find it.My problem is i can`t move downloaded files over to root filesystem, i have downloaded and unpacked them to files. to change it`s looks and downloaded a skin, i open root, go to usr---> amsn ---> share --> skins, now i am to copy the file of the skin over to the root directory, butI also tried alt+f2, writing sudo conqueror, as an advice i got, but there was noe difference.
View 14 Replies
View Related
Dec 17, 2009
what I got - from a crontab run a script (understand that part), this script needs to count the amount of files in /outgoing/, then take 30 less that number, and move that many files from /readycalls/. I need to keep the asterisk outgoing que full of .call files with out having to many in there at any given time.
View 3 Replies
View Related
Jun 8, 2010
I have many files and folders in my source folder. I want to copy some files and folders from that source folder to destination folder. What should be require to given with the "cp" command?
View 1 Replies
View Related
Jun 6, 2011
I am a new kdesvn user. I would like to know if it is possible to
a. rename
b. move file
c. move folder
in svn using kdesvn
View 3 Replies
View Related
Sep 6, 2010
I have a directory with a bunch of scripts and other random files. I want to move the files with the executable flag set to another folder en masse (or, if it's easier, the ones without the x flag). Is there an easy way?
View 1 Replies
View Related
Jun 24, 2011
In my bash script I need to move files in a folder if it is not in use.
Code:
for entry in `ls /root/shared_storage/input`; do
echo $entry
run=`lsof /root/shared_storage/input/$entry`
ru=${run:0:5}
echo $entry
if [ "$ru" == "" ]; then
........
It worked fine sometimes but sometimes it just get stuck at lsof. Is there any other way that I can use here to check if the $entry is using some other process?
View 10 Replies
View Related
Apr 3, 2011
When I used windows as my media server I had a program called SCRU (Scene release unpacker - [URL] that could unpack and move my downloads to folders based on their names. Is there something like that for linux?
View 1 Replies
View Related
Aug 31, 2010
Is there a way to add files/folders to a tar file?
I am using the tar command for compression.
View 2 Replies
View Related
May 8, 2010
I have a directory (let's say A) with a few hundred files and subdirectories and a copy of this directory (let's say B). All the files and subdirectories in B have a newer date than A. However only a few of them are really changed files. Is there a way to find those files and directories? Basically they have different sizes so this could be used to compare them with the files from A.
View 3 Replies
View Related
Nov 18, 2010
how to access files and folders on alive computers on my college LAN,i hv angry ip scanner installed but it only lists the computers on lan,whereas i want to access files(e.g copying,etc) on others computers(in the same way we do in advance ip scanner in windows). i am using ubuntu 10.04 LTS
View 1 Replies
View Related
Jan 19, 2010
At the moment I'm using:"cp -ap . /destination-folder"to copy everything from the folder I'm in to another folder.That works.Is it possible to cp everything except:folder1/folder2/in the current folder I'm in?
View 2 Replies
View Related
Sep 29, 2009
I have a php script in cron directory that generates 5 textfiles, after the files are generated, I want to create a script that will move the 5 text fiels to anoher folder name "web".
View 2 Replies
View Related
Nov 2, 2010
I have run a command which finds a lot of files based on some search criteria. It returns the files like so:
./somepath/somepath/file.something
./asdf/asdf/s.php
./etc/a.php
./a/b/c/d/e/f/g.jpg
So I was wondering, if I capture this output into a file (ie. one file per line), can anyone help me write a command which iterates through the file and moves the files one by one to a specified directory?
View 3 Replies
View Related