Visit Our UNIX and Linux User Community

Top Forums Shell Programming and Scripting Script to order my video library :-) Post 302850745 by Don Cragun on Thursday 5th of September 2013 01:15:39 PM
Old 09-05-2013
Originally Posted by rjalex
Dear friends,
I have a hundred or so videos I keep in a directory, but as the collection has grown anarchically in the past years I have at least 3 different situations:

a) one directory for each video and within it the video and any other accompaining files (mostly text files with my notes and reviews). This is the desired end state for all of them

b) a single movie file sitting in the top directory (extensions can be flc, mkv, avi,mpg etc.). These I would like to move into a directory with the same name as the file

c) single non-movie files. these I'd ignore for now.

Thanks for any help.
Am I correct in interpreting your requirements to be:
  1. You are sitting in a directory that contains both regular files and directories.
  2. You do not want to do anything with any files in directories under the directory in which you're sitting.
  3. You want to move regular files that have a file extension (such as .flc, .mkv, .avi, .mpg, or anything else) into a new directory. (It isn't clear to me whether you want to move a regular file like "movie.mkv" to "movie.mkv/movie.mkv" or to move it to "movie/movie.mkv". Which do you want?)
  4. You do not want to move (or remove) regular files that do not have a file extension.
Is this correct? (And, if so, do you want new directory names to have the extension stripped off from the names of the files that will be moved to them?)

Last edited by Don Cragun; 09-05-2013 at 02:17 PM.. Reason: Fix typos
This User Gave Thanks to Don Cragun For This Post:
Test Your Knowledge in Computers #348
Difficulty: Easy
Awk's built-in variables include the field variables: $1, $2, $3, and so on ($0 represents the entire record).
True or False?

6 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Changing the order of columns in a script

I have the following script: (echo -n `curl | grep mylocation`; date +%Y%m%d%H%M%S) >> myscores.txt This script works fine, except that it places the timestamp at the end of the file myscores.txt. How do add the timestamp as the first column and then a tab and... (4 Replies)
Discussion started by: figaro
4 Replies

2. Linux

USB video capture? composite, s-video, etc

does anybody have any experience with any of these composite video to usb devices on linux? usb video capture - Google Product Search would like to get one but a linux newbie and having trouble figuring out if any are ported... i've found lots of things that link to DisplayLink... (1 Reply)
Discussion started by: danpaluska
1 Replies

3. UNIX for Advanced & Expert Users

Video Cards :: Video Memory Intercept and Redirect

I need a broad spectrum understanding on this subject, and any help would be greatly appreciated. First of all, as I understand it... The way the video hardware works is the CPU sends information about input and possible changes to the display, the video card receives these changes, makes the... (2 Replies)
Discussion started by: ciNG
2 Replies

4. Shell Programming and Scripting

script for remove descending order number

hi all i want to remove some descending order number example : 1 100 200 135.00 Gk_wirs 1 1 100 200 136.00 Gk_wirs 50 1 110 210 138.00 Gk_wirs 60 1 100 200 136.00 Gk_wirs 57 ----> how to remove... (6 Replies)
Discussion started by: nithyanandan
6 Replies

5. Shell Programming and Scripting

Script to solve second order (polynomial) interpolation

Currently I have awk command to do linear interpolation awk ' { P=$2 I=$1 } END { j=0; s=I; t=I for(i=m;i<=n;i++) { if(I && i>t) { j++; s=I; t=I } print i, P+(i-s)*(P-P)/(t-s) } } ' m=1 n=8 infile FILE CONTENT... (8 Replies)
Discussion started by: Tzeronone
8 Replies

6. Shell Programming and Scripting

Script Execution Order

Hi, I have two scripts which are mentioned in more ./ //line 1 should not return error ./ //line 2 may return error ./ //line 3 should not return error Condition: I want to complete before starting (1 Reply)
Discussion started by: mohtashims
1 Replies
pia(1)							      General Commands Manual							    pia(1)

pia - play media files SYNOPSIS
pia [ options ] movie DESCRIPTION
pia is a small X11 tool which plays movie files. OPTIONS
pia understands the usual toolkit options (-geometry + friends). Additional options are: -h display help text -v be verbose. -debug enable debug messages. -dsp <dev> Use OSS device <dev> for sound. -noxv Disable Xvideo extension. -nogl Disable OpenGL. -noaudio Don't play sound. -novideo Don't play video. -slow n Slowdown video playback by factor n. n=2 doubles playback time, ... This also turns off audio playback. SUPPORTED MOVIE FORMATS
Main purpose of this utility is to playback movie files recorded by xawtv, motv and streamer. It should be able to playback every AVI or QuickTime movie written by one of the mentioned utilities. Feel free to submit a bug report if this doesn't work for some file. QuickTime pia uses libquicktime to decode quicktime movies, thus it should be able to decode and playback all movies with codecs supported by libquicktime. AVI AVI support is very limited. Video: uncompressed RGB data (15 and 24 bpp) and mjpeg is supported. Audio: only uncompressed PCM data works. WAV WAV files are playable too, with the same limitation like AVI audio: only uncompressed PCM data. AUTHOR
Gerd Knorr <> COPYRIGHT
2002 Gerd Knorr Copyright (C) 2002 Gerd Knorr <> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER- CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (c) 2002 Gerd Knorr pia(1)

Featured Tech Videos

All times are GMT -4. The time now is 09:45 PM.
Unix & Linux Forums Content Copyright 1993-2020. All Rights Reserved.
Privacy Policy