03-31-2011
Script to move files with similar names to folder
I have in directory /media/AUDIO/WAVE many .mp3 files with names like:
my filename_01of02.mp3
my filename_02of02.mp3
Your File_01of06.mp3
Your File_02of06.mp3
etc....
In the same directory, /media/AUDIO/WAVE, I have many folders with names like
9780743579490
9780743579491
etc..
Inside the folders I have files:
(Inside folder 9780743579490 is)
9780743579490_01of6_Your File.wav
9780743579490_02of6_Your File.wav
What I need, is a script to find what folder the .wav files that have the same filename at the .mp3 files in /media/AUDIO/WAVE, and move the mp3 files into the folders with the wav files that share the same file name.
To be clear the mp3 part "01of06" is in a different place than the .wav file and the wav file has a 13 digit number in the beginning that the mp3 doesnt, so you will have to match what happens before the first underscore on the mp3 file with what happens between the last underscore and the file extension in the .wav file!
Last edited by glev2005; 04-01-2011 at 10:47 AM..
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello Friends,
I have .tar files which exists under different directories after the below code is run:
find . -name "*" -type f -print | grep .tar > tmp.txt
cat tmp.txt
./dir1/subdir1/subdir2/database-db1_28112009.tar
./dir2/subdir3/database-db2_28112009.tar... (2 Replies)
Discussion started by: EAGL€
2 Replies
2. Linux
Hi Team,
I have over 1 lakh pdf files.
I want to create folders like Disk-1, Disk-2 ..... & want to move 3000 pdfs per folder. Can i do it by script? Please help me.
Thanks & Regards
Parag Nehete (4 Replies)
Discussion started by: paragnehete
4 Replies
3. Shell Programming and Scripting
I have two files like this:
fileA.net
A
B
C
fileA.dat
1
2
3
and I want the output
output_expected
A 1
B 2
C 3
I know that the easier way is to do a paste fileA.net fileA.dat, but the problem is that I have 10,000 couple of files (fileB.net with fileB.dat; fileC.net with... (3 Replies)
Discussion started by: valente
3 Replies
4. Shell Programming and Scripting
Hi All,
I have to requirement to write a shell script to move file from one folder (A) to another five folder (B,C,D,E,F) and destination folder should be blank. In not blank just skip.
This script will run as a scheduler every 2 minutes. It will check number of files in folder A and move 1 to... (9 Replies)
Discussion started by: peekuabc
9 Replies
5. Shell Programming and Scripting
So, I have a directory tree that has many files named thusly:
X_REVY.PDF
I need to find any files that have the same X portion (which can be nearly anything) as any another file (in any directory) but have different Y portions (which can be any number from 1-99).
I then need it to return... (3 Replies)
Discussion started by: Kamezero
3 Replies
6. Shell Programming and Scripting
Hi,
I need to write a script the has to copy the files from folders and subfolders to the same folder structure located in another location.
Ex:
mainfolder1
file1,file2,file3 subfolder1(file1,etc) subfolder2(file1,etc) to another folder location of same folder structure.
rsync is not... (7 Replies)
Discussion started by: Raji Perumal
7 Replies
7. Shell Programming and Scripting
I want to move a folder with spaces from one folder to another.
I have two folders like this,
1).RT_032-222 -4444-01/ 2). RT_032-555 -7777-01/
I want to move files from 2 to 1 through shell script.Here I want to assign this like a user defined variable like as Source branch... (2 Replies)
Discussion started by: kannansoft1985
2 Replies
8. Shell Programming and Scripting
Hello,
I need to move all the files inside /XYZ (has multi-depth sub directories) that are older than 14 days to/ABC directory but with retaining the SAME directory structure.
for example:
/XYZ/1/2/3/A/b.txt should be moved as /ABC/1/2/3/A/b.txt
I know about find /XYZ -type f -mtime +14... (3 Replies)
Discussion started by: prvnrk
3 Replies
9. Shell Programming and Scripting
We are receiving few zipped files in one location say : apple/oranges/incoming
All .zip files are placed here in incoming folder.
So few of the files are password encrypted.
There are only 10 zipped files, so we are planning to create a script which will pick that zip file from incoming... (1 Reply)
Discussion started by: Sidhant
1 Replies
10. Shell Programming and Scripting
Hi Team,
I am new to shell script and there is a requirement where files should be moved from Subfolder to parent folder.
Eg:
parent folder --> /Interface/data/test/IN
Sub folder -->/Interface/data/test/IN/Invoice20180607233338
Subfolder will be always with timestamp... (6 Replies)
Discussion started by: srivarun15
6 Replies
BURN(1) Burn BURN(1)
NAME
burn - record from various sources to optical media (CD, DVD)
SYNOPSIS
burn MAIN_MODE [OPTIONS]... [FILE/S]...
burn --help
DESCRIPTION
CD-writing program/script. Features Data-CD, Audio-CD, Copy on the fly, Iso-CD.
CONFIGURATION
Configuration files for burn are: ~/.burnrc or /etc/burn.conf. You can edit them to change values.
If you don't have these files you can:
1. use burn-configure utility
2. take the configuration template, edit and copy it as ~/.burnrc or /etc/burn.conf
MAIN MODES
-D, --data-cd
To create Data-CD
-I, --iso-cd
To create ISO-CD
-C, --copy-cd
To copy CDs
-A, --audio-cd
To create an audio CD from WAV, MP3 and ogg files
EXAMPLES
# burn -D -p /etc/
Creates a CD with /etc/ contents. (you will find files and directories contained in /etc in CD's root.)
# burn -D -p /home/bigpaul/video/summer_2003/spain.tar.gz
Creates a CD with spain.tar.gz in CD's root
# burn -D -r /etc/
Creates a CD containing the whole /etc/ directory. (-r preserves path)
# burn -D -c /mail_2003 /home/bigpaul/Mail -p /boot/vmli*
Creates a CD containing the whole /home/bigpaul/Mail renamed into /mail_2003. (-c changes path name). This command also adds in CD's root
every vmli* file in /boot/ directory
# burn -I -n image.iso
Burns image.iso
# burn -C
Copy CDs (disk at once).
# burn -A -a *.wav
Creates an Audio CD. Tracks come from wav files
# burn -A -a *.mp3
Creates an Audio CD. Tracks come from mp3 files
# burn -A -a *.ogg
Creates an Audio CD. Tracks come from Ogg Vorbis files
# burn -A -a *.mp3 file.ogg track01.wav
Creates an Audio CD preserving input order. In this example the first audio tracks will come from mp3 files, than we will find the one from
file.ogg and finally the one from track01.wav
GENERAL OPTIONS
-s, --simulate
to perform a burn simulation
DATA-CD OPTIONS
-p, --path
add file/s or path's content to CD-ROM's root. e.g.: -p /cvs/myproj/. In this example we will find CD-ROM's root filled with
/cvs/myproj/ contents, but no /cvs/myproj/ will be created
-r, --preserve-path
add file/s or path's content to CD-ROM preserving original path. e.g.: -r /cvs/myproj/. In this example we will find /cvs/myproj/
in CD-ROM's root
-x, --exclude-path
every file or directory matching this string will not be included
-c, --change-path
old_path will be named new_path in CD-ROM. e.g.: -c /my_home/2004_Jan/ /home/bigpaul/. Thus /home/bigpaul/ will be named
/my_home/2004_Jan/ in CD-ROM.
-l, --follow-symlink
this option allows burn to follow symbolic link directories
-m, --multisession
this option allows multisession CDs
ISO-CD OPTIONS
-n, --name
image name
AUDIO-CD OPTIONS
-a, --audio-file
mp3, ogg or wav file/s
AUTHOR
Ben Finney <ben+python@benfinney.id.au>, Gaetano Paolone <bigpaul@hacknight.org>
COPYRIGHT
This is free software: you may copy, modify, and/or distribute this work under the terms of the GNU General Public License, version 2 or
later as published by the Free Software Foundation. No warranty expressed or implied. See the source for details.
2009-07-22 BURN(1)