Sponsored Content
Top Forums Shell Programming and Scripting Renaming Movies (or Flipping Portions of Filenames Using sed or awk) Post 302437853 by radoulov on Friday 16th of July 2010 10:04:27 AM
Old 07-16-2010
You can use something like this:

Code:
for movie_dir in [12][09][0-9][0-9]_*/; do
  year=${movie_dir%%_*} tmp=${movie_dir%__*}
  movie=${tmp#${year}_}
  [ -d "$movie"_"$year" ] && {
    printf 'directory %s already exists ...\n' "$movie"_"$year"
    continue
    }
  mv -- "$movie_dir" "$movie"_"$year"
done

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Renaming of multiple filenames

Hi All, I need to rename the file names. I need to rename for example as follows file001 to flat1 file100 to flat100 Thanks Shash :confused: (7 Replies)
Discussion started by: shashi_kiran_v
7 Replies

2. UNIX for Dummies Questions & Answers

Renaming of multiple filenames

Hi All, I need to rename the multiple file names. I need to rename for example as follows bas100e1_jun05 to FLAT1 bas100e2_jun05 to FLAT2 bas100e18_jun05 to FLAT18 Please not that I can cut_jun05 from the filename. Madhan had helped with a similar kind of script. But this is a new... (4 Replies)
Discussion started by: shashi_kiran_v
4 Replies

3. UNIX for Dummies Questions & Answers

renaming filenames

I have 7 files with 7 different names coming into a specified folder on weekly basis, i need to pick a file one after another and load into oracle table using sql loader. I am using ksh to do this. So in the process if the file has error records and if sql loader fails to load into oracle tables,... (0 Replies)
Discussion started by: vpv0002
0 Replies

4. Shell Programming and Scripting

mass renaming files with complex filenames

Hi, I've got files with names like this : _Some_Name_178_HD_.mp4 _Some_Name_-_496_Vost_SD_(720x400_XviD_MP3).avi Goffytofansub_Some name 483_HD.avi And iam trying to rename it with a regular pattern. My gola is this : Ep 178.mp4 Ep 496.avi Ep 483.avi I've tried using sed with... (8 Replies)
Discussion started by: VLaw
8 Replies

5. UNIX for Dummies Questions & Answers

renaming multiple files using sed or awk one liner

hi, I have a directory "test" under which there are 3 files a.txt,b.txt and c.txt. I need to rename those files to a.pl,b.pl and c.pl respectively. is it possible to achieve this in a sed or awk one liner? i have searched but many of them are scripts. I need to do this in a one liner. I... (2 Replies)
Discussion started by: pandeesh
2 Replies

6. Shell Programming and Scripting

Renaming files & folder according to the similarities in filenames

hello does someone want to help me for this one ? i want to rename files & a folder according to the similarities in filenames for example : the file with the good name cglogo tougl1953 dgmel bogd 01 -- ttgductoog ggdté gollogtd.ext1the others files needed to be renamed cglogo... (5 Replies)
Discussion started by: mc2z674gj
5 Replies

7. Shell Programming and Scripting

Renaming Filenames by replacing a part

Hi, I have little experience on Shell scripts, I searched the forum but couldn't make out what I want. I want to rename a set of files to a new file name a_b_20100101 c_d_20100101 ....................... ...................... I want to rename the files to a_b_20140101... (5 Replies)
Discussion started by: JaisonJ
5 Replies

8. Shell Programming and Scripting

Renaming files with Spaces in Filenames

Entry level scripter. Any help appreciated. for file in *; do rename '4321_' '' $file ; done Doesn't work for files with spaces in between FOr eg 4321_1004.dat is renamed to 1004.dat but 4321_1004 2008.dat stays the same (1 Reply)
Discussion started by: davnavin
1 Replies

9. UNIX for Beginners Questions & Answers

Match Strings between two files, print portions of each file together when matched ([g]awk)

I have two files and desire to use the strings from $1 of file 1 (file1.txt) as search criteria to find matches in $2 of file 2 (file2.txt). If matches are found I want to output the entire line of file 2 (file2.txt) followed by fields $2-$11 of file 1 (file1.txt). I can find the matches, I cannot... (7 Replies)
Discussion started by: jvoot
7 Replies

10. UNIX for Beginners Questions & Answers

Match Fields between two files, print portions of each file together when matched in ([g]awk)'

I've written an awk script to compare two fields in two different files and then print portions of each file on the same line when matched. It works reasonably well, but every now and again, I notice some errors and cannot seem to figure out what the issue may be and am turning to you for help. ... (2 Replies)
Discussion started by: jvoot
2 Replies
qc2movie(1)						    BSD General Commands Manual 					       qc2movie(1)

NAME
qc2movie -- Quartz Composer export tool SYNOPSIS
qc2movie inCompositionPath|repositoryCompositionIdentifier outMoviePath width height duration [--parameterKey1 value1 ...] DESCRIPTION
qc2movie is a tool that exports a Quartz Composer composition into a QuickTime movie by adding a track containing this composition. It is the command line equivalent of exporting a composition for the Quartz Composer application to a QuickTime movie. OPTIONS
inCompositionPath|repositoryCompositionIdentifier specifies which composition you want to export. Ar inCompositionPath is the path to the composition. Ar reposito- ryCompositionIdentifier is the identifier of a composition which lies in the Quartz Composer Repository. outMoviePath specifies movie file path to which the composition will be exported to width defines the width of the export movie height defines the height of the export movie duration defines the length of the export movie [--parameterKey1 value1 ...] passes composition specific parameters through the command line tool to the composition EXAMPLES
-To create a 10 second QuickTime movie containing a Quartz Composer track of the Particle System composition: qc2movie "/Developer/Examples/Quartz Composer Compositions/Particle Systems/Particle System.qtz" ~/example.mov 640 480 10 -To merge two video tracks (30s each) together using an image transition protocol abiding composition (Swing for example) in the Quartz Composer Repository (using its identifier: /swing): qc2movie /swing ~/merged-example.mov 640 480 60 --inputMoviePath1 ~/firstVideo.mov --inputMoviePath2 ~/secondVideo.mov --duration 2 -To apply an image filter protocol abiding composition to the video track of a movie: qc2movie /colorpencil ~/effect-example.mov 640 480 30 --input ~/Video.mov SEE ALSO
pcastaction(1) Mac OS July 9 2007 Mac OS
All times are GMT -4. The time now is 12:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy