Ubuntu :: Renaming Video Files Based On The Date Created

Aug 4, 2011

I have hundreds of MTS and AVI files since 2000 and would like to rename them in the following manner based on the date created: DD-MMM-YYYY HH.MM.SS_X; where X begins at 1 and increments by 1 if there are dublicate date/time stamped videos.

Ex: 19-Nov-2002 08.12.30.avi, 19-Nov-2002 08:13:30_1 and 19-Nov-2002 08:13:30_2

Someone previously wrote the following script for me, and it works great for photos. It uses EXIV2 to get the image date created info. I have tried to understand the script, but am struggling. The video files I have can use the date modified since I have not modified them since I filmed them.

#!/usr/bin/env python
import os
import stat
import pyexiv2
import time
directory = '/home/david/Desktop/test'
[Code].....

View 1 Replies


ADVERTISEMENT

Ubuntu :: Created A Little Bash Script For Renaming Files From A Folder?

Feb 28, 2010

I created a little bash script for renaming files from a folderEvery time i hv to put that bash script file (rename.sh) in folder Is there any ways i will call (rename.sh) from terminal without moving rename.sh into any folder ?ne More Question : Whenever i run any .sh file automatically one .sh~ file created it is my programing mistake or is it exists ?

View 7 Replies View Related

Fedora :: Automatically Renaming Files While Sorting By Date?

Apr 17, 2010

I often record music from the webradio with Streamtuner.How can I rename the mp3 files recorded in a way that numbers are added to the beginning of the filename representing the order in which the titles were played on the webradio station?I am looking for an automated solution like a renaming tool since there are usually hundreds of files in a directory. I used autorename / ARen for windows back in the day when I was still on XP. What I could do with the tool was:a) Sort the files by date of creationb) add an increasing number at the beginning of the filename based on the position in the sorted list.

View 3 Replies View Related

SUSE :: Renaming Multiple Files - Adding Date / Time Stamp In Name

Feb 1, 2009

I am trying to rename multiple files in a directory and add the Date/Time stamp to the file name.

Example:
file1.txt
file2.txt
file3.txt

Renamed to
2009_02_01_21.txt
2009_02_02_21.txt
2009_02_03_21.txt

I am able to accomplish this using this command:
mv file1.txt "`date +%Y_%m%d_%H`".txt

But I want to automate this task, I have many files to process and I dont want to do them one by one.

I already tried this but it does not work
mv *.txt "`date +%Y_%m%d_%H`".txt

View 2 Replies View Related

Programming :: Sort Files In Directories Based On Files Date

Sep 8, 2009

I need a script that will take all the files in a given directory and create new monthly sub-directories and sort all the files based on the creation date into the appropriate directory.For example, all files created between 01/01/09 and 01/31/09 will be placed in 'JAN-2009'

View 5 Replies View Related

Ubuntu :: Deleting Files Based On Number Created (or In Folder?)

Jul 21, 2011

I'm dipping my toes into some bash scripting and was wondering if there was a way to delete a file not based on how old it is, but rather how many other files are currently in the folder... or something to that effect....

What I'm doing is creating a script to back up a folder nightly. I'd like to keep a maximum of 3 backups. However in case the script for some reason fails to run one night (computer turned off possibly) I don't want to set the condition for deletion to be the date.

I know that if I run:

Code:
find /path/to/files* -mtime +3 -exec rm {} ;
that it will delete everything older than three days. -atime and -ctime don't seem to be what I"m looking for... is there another command I can use to achieve what I"m trying to?

View 5 Replies View Related

General :: Finding Files Based On Date Without Using `find`?

Aug 11, 2011

I know find can do what I am looking for, but I am wondering if there is an alternative way to find files on the filesystem either created before/after a certain point, or at a certain time.

Typically I rely on updatedb & locate for most of my file searching needs. Issues with those tools, though, are that it only has directory and file names, and it only creates a database of local directories, not anything mounted via CIFS|NFS or via -o loop (eg, .iso images).

So if I need to find files created after yesterday across the entire system (local and remote filesystems), I am currently needing to use find.

What other tools, if any, would accomplish this in a similar fashion?

I have tried ls and grep, but that requires (in my attempts so far) multiple searches:

ls -lR | grep Aug | grep 10
ls -lR | grep Aug | grep 11

View 6 Replies View Related

Ubuntu :: Sequentially Number Files Based On Date Modified - Rename Cli

Nov 8, 2010

Sequentially number files based on date modified (rename cli)

I'm almost done a larger script which takes all the pictures in a folder, converts it to video, and emails it to me. Everything worked fine until I realized the picture filenames weren't always starting at 1, then ffmpeg chokes.

I have a bunch of files in a folder which I need to rename to:

I don't want to install any additional packages and I'd like this to run in a single command if possible.

If not possible, then a bash script would work too.

View 3 Replies View Related

Programming :: Copy All The Files In The Directory Based On The Modification Date?

Dec 29, 2010

Originally Posted by Kenny_StrawnPlease wrap [CODE] tags aroung any code posted here. The full source that way could still be posted.I am trying to copy all the files in the directory based on the modification date (i.e created on Dec 29). Not able to find the proper command for this. This is what I have tried.

(none) login: root
#
# cd /mnt/hd/

[code]...

View 8 Replies View Related

Ubuntu Multimedia :: Digikam - Renaming On Import - "Create Date" Versus "File Modification Date"

Jan 24, 2011

I just switched from a basic digital camera to a more advanced one that stores both Jpeg and Raw (.Nef - it's a Nikon) files for me.When importing files in Digikam, I rename the files so that they start with Date and Time. Example: 20110121-223748.JPG for a photo taken on Jan 21st 2011 at 22:37:48.I was a bit surprised when importing both the JPEG and the Raw version of the same photo, that the filename is different by a few seconds (no constant offset, sometimes they are the same):

20110121-223748.JPG
20110121-223750.NEF

I did some "research" by looking at the exif data of both files (using "exiftool 20110121-223748.JPG" from the command line). Here is what I got back

(amongst other data):20110121-223748.JPG
File Modification Date/Time : 2011:01:21 22:37:48+01:00
Modify Date : 2011:01:21 22:37:48
Date/Time Original : 2011:01:21 22:37:48

[code]....

So it seems that Digikam is using the "File Modification Date/Time" (different in the Jpeg's and Raw's of my camera) rather than the "Create Date" (the same for both Jpeg and Raw). (The few seconds difference in "File Modification Date/Time" between the two versions of the same photo is probably due to the time that my camera needs to write away the data on the SD memory card. I guess.) Is there a way to have Digikam use the Create Date? (Or the Date/Time Original?)

PS: I'm on Ubuntu 10.04LTS, using DigiKam 1.2.0

View 1 Replies View Related

General :: Use Date With Touch To Create New File With Date Based Name?

Mar 12, 2010

I am using CRON to create a new, blank file, every minute, in a specific location on my web server. After web searching, and reading man pages, I get the impression that the following command is supposed to work:touch /home/mydomain/var/folder/attachments/`date +%H%M`.txtThis should give me a new file with a file name that is the current hour and minute.However, when executed, the CRON mailer reports:touch /home/mydomain/var/folder/attachments/`date +/bin/sh: -c: line 0: unexpected EOF while looking for matching /bin/sh: -c: line 1: syntax error: unexpected end of fileSo, it looks like shell is seeing the plus (+) sign as an EOFObviously, nothing get created.What would be the easiest, single line command to create an empty file, at a given location, with a time based file name

View 5 Replies View Related

General :: Batch Renaming Based On Wildcards?

Jul 20, 2010

Is there a way to do a batch renames of files that will keep each individual filename, but change it in the way I want?

The specific issue is this. I have a harddrive with something like 1300 movies on it. They're all organized alphabetically, but there are like 200 movies that begin with 'The'. I want to rename all of these movies that begin with The so that the The at the beginning is dropped and added at the end (for example, turn "The Shawshank Redemption" into "Shawshank Redemption, The"). I'd like to do this with a simple command if its possible.

View 2 Replies View Related

Programming :: File Renaming Based On A Pattern Match

Jan 8, 2011

What I am attempting to do is rename some television shows into the format that my PVR will understand for the naming convention. I have a script that cleans them up about 95%, now I just cant figure out the last little detail..

For example: NCIS_01.mkv
I think it can be done in sed, but I just figure out how. I need it to be renamed to: NCIS_s01e01.mkv

How can I make sed (or something else) match the last "_" and any numbers after it until the period and then insert text between them reliably?

Depending on the show, it can be something like: This_show_name_243.avi so I need it to be more flexible than I can figure out how to do..

View 6 Replies View Related

Ubuntu Multimedia :: Replace Jpg Files Last Modification Date With Timestamp Creation Date?

Sep 22, 2010

I'm looking for a method for modifying some jpg photo files last modification date with the corresponding timestamp creation date of each file.The reason is that shotwell import pictures in folders according to last modification date which is stupid on my opinion.

View 2 Replies View Related

General :: Get Week Number Based On Date With Different First Day It In Gawk?

Jun 24, 2011

How to get the week number in linux using gawk with different first day of the week? the date command can give me the week number with +%V but it is based on Monday (1-53) or +%U (based on Sunday, 0-53).

I tried to to do this: date -d "ddmmyy+2days" +%V, but the result is not correct. I want the first day of the week is based on Saturday.

View 1 Replies View Related

General :: Selectively Tar Based On Date Just The Innermost Directories Of A Single Directory?

Jul 28, 2009

selectively archive the subdirectories of a single parent directory in which said subdirectories have creation year-date 2008 and older.

View 5 Replies View Related

SUSE :: Determine The Report File Name Based On The Source Directory Name And Current Date?

Apr 17, 2010

### TO DO: Determine the report file name based on the source directory name and current date### The report name and thumbnail directory must follow this pattern: source-%j-%H### for example, for pictures in /home/you/pictures, the file name will be: pictures-%j-%H### HINT: Use sed to extract the directory name from the path and combine it with date command output

View 1 Replies View Related

Ubuntu :: Renaming Files Through Bash

Feb 10, 2011

I'm trying to rename ~11000 files. What has happened is I have files in the following format:

string1_100_string2_200_string3_300.log

now the numbers 200 and 300 are sometimes below 100 and the file looks like this:

string1_100_string2_99_string3_99.log

and I want to rename such files to be like this:

string1_100_string2_099_string3_099.log

I wrote a small matlab script but it seems to take forever so thought I'd try and do it bash and have got near to nowhere....

View 3 Replies View Related

Ubuntu :: Renaming Downloaded Files - Adding '

Jan 11, 2011

Whenever I download a file using Firefox or Google Chrome and it has a ' character on it's filename, the file is renamed and a is added before the '. It's really annoying and I'd like to know how can I solve this issue.

View 9 Replies View Related

Ubuntu :: Renaming Files By Shotwell 'title'?

Mar 31, 2011

I've used Shotwell to give titles to a lot of photos, and now realise that I want to also rename those files using the title. I see that Shotwell saves the title into XMP IPTC structure, using this: dc:title[x]. how to batch rename a bunch of files using this data?

View 3 Replies View Related

Ubuntu :: Script For Renaming Files Giving Them The Name Of The Folder They're In?

Feb 2, 2010

I have a folder where all of my movies are placed. Each movie lies in its own folder. I want to write a script which renames all the movie files and gives them the name of the folder they are in.For example I want this file:/home/tryfon/movies/Black Irish [2007]/black.irish.dvdrip.avi to be renamed to /home/tryfon/movies/Black Irish [2007]/Black Irish [2007].aviOne issue is that the video files are of several file types (mostly avi, divx and mkv).Another issue is that some movies consist of two parts, so if a second avi file is found I would like the two (or more) files to be named like: "Black Irish [2007] CD1" and "Black Irish [2007] CD2", or if this is not possible at least notify me of the folders that contain more than one video fil

View 2 Replies View Related

Ubuntu :: Mass Renaming Files - Get Rid Of Two Extra Characters On The End

Feb 12, 2010

I have a folder with various subfolders of files. These files all have two extra characters on the end that I want to get rid of. How would I go about telling the terminal to go into X directory and every subdirectory of X directory, look for all files with the extra characters, remove them, and keep everything else the same?

View 3 Replies View Related

Ubuntu Networking :: Bulk Renaming Files On A SMB Share?

Jan 23, 2011

I have a Netgear ReadyNAS NV in the basement, that I want to use to serve up video files over my network to a TV in the living room.

Now, I have a lot of files that HandBrake encoded and it gave the files an m4v suffix. Even when the files are in a codec that the TV can handle, it refuses to load them because of this suffix... so I want to rename them all.

This is fairly simple for files on a local filesystem. I can simply cd into the directory containing the files, and do something like the commands below.

Code:
$ for a in `ls`;
> do
> stem=`echo ${a} | cut -f1 -d"."` ;
> mv ${a} ${stem}.mpg ;

[Code]....

Although there are a few smb commands available (smbstatus, smbget, etc.), I've not found any commands like smbls or smbmv.

Are there any special commands or utilities around that can do the kind of thing I'm trying to do?

View 1 Replies View Related

Ubuntu Servers :: Renaming Files Recursively From Folder

Mar 26, 2011

I'm trying to rename files recursively from a folder. I want to delete the & from every filename. i've searched the net and found the following script:

Code:
#!/bin/bash
dir=/whatever/directory
for file in `ls $dir` ; do
# ANYCASE TO UPPERCASE:
newname=`echo $file | tr '[a-z]' '[A-Z]'`
mv $dir/$file $dir/$newname
done
and changed it:

Code:
#!/bin/bash
dir=/home/test
for file in `find $dir -type f` ; do
#rename files containing &
newname=`echo $file` | tr '[&]' ''
mv $dir/$file $dir/$newname
done

But the for loop explodes the filename after each & sign, so i don't have a whole filename. if the file is named lorem & ipsum, the for loop will break it in 3 parts.

View 2 Replies View Related

Ubuntu Multimedia :: Renaming Recovered Music Files

May 18, 2011

I managed to very stupidly (and avoidably) overwrite the hard drive that contained all my stuff--music, photos, home videos from the 80's that were painstakingly converted to digital movies, etc.After running Photorec and recovering much of the data to another disk, I'd like to be able to rename the music files using whatever exif data/tags are available.

View 6 Replies View Related

Ubuntu :: Renaming Multiple PDF Files (Replacing Sign)

Jun 21, 2011

I have many pdf files which contain "%" sign also in the name. I want to rename that all files by replacing "%" to "-" Its hierarchy of many files and folders. Is there any solution to do this at one time? OR any script for this?

View 7 Replies View Related

General :: What's The Command For Renaming Files

Jun 8, 2010

What's the command for renaming files? I thought it was "mv"--I typed "info" and read

Quote:

* mv: (coreutils)mv invocation. Rename files. So, desiring to give a .JPG extension to a jpeg file that had no extension (because I dug it out of my Firefox cache), I typed

Quote:

mv '/home/josh/Desktop/Natalie pictures/DEC8FFA5d01' *.jpg

That didn't rename the file; it made the file disappear from its folder. What did I do wrong?

View 6 Replies View Related

Software :: Renaming Or Copying Some Files?

Apr 19, 2011

i have some files on my server that i can not rename or copy it seems file names are some how strange for linux (centos)the names are like this way :

Spirited.Away.2001.HDRip_-_(Film98-Net).mkv
Up.2009.BRrip_-_(Film98-Net).mkv
How.To.Train.Your.Dragon.2010.720p.Bluray_-_(Film98-Net).mkv

[code]...

View 6 Replies View Related

Ubuntu :: Renaming All Files In Directory But Leave The File Extension Alone?

May 22, 2010

how can I rename all files in a directory up to the first dot (there by leaving the file extension alone) to the same thing? Im trying to rename all my media files and associated files in a directory to (preferably) the name of the directory it self. if I have

Code:

A Clockwork Orange -
wzzyfg.cd1.avi
wzzyfg.cd2.avi
wzzyfg.nfo
ACO.fanart.jpg
orange.tbn

Id like to automatically mass rename them all to

Code:

A Clockwork Orange
A Clockwork Orange.cd1.avi
A Clockwork Orange.cd2.avi
A Clockwork Orange.nfo
A Clockwork Orange.fanart.jpg
A Clockwork Orange.tbn

I have rename on my server which I used to remove underscores from file names, but I dont know how I would use it to rename everything up to the first period. Bonus points for renaming stuff to the name of the parent folder!

View 5 Replies View Related

General :: Batch Renaming Of Files In A Directory Using Sed

Dec 11, 2010

I run a script which generated about 10k files in a directory. I just discovered that there is a bug in the script which causes some filenames to have a carriage return (presumably a '' character).

I want to run a sed command to remove the carriage return from the filenames.

Anyone knows which params to pass to sed to clean up the filenames in the manner described?

I am running on Linux (Ubuntu)

The character causing the filename to 'break up' accross multiple lines appear to be a CR (carriage return) instead of ' '. The filename is being diaplayed in thetitle of a text editor with %0D in the positions of where the file name breaks up. So I need to remove the CR chars from my filenames.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved