Software :: Bash - Rename Filenames With Corresponding Filenames?

Dec 1, 2009

I got a filename called like this:

beach---------20090808-110000.ogg
beach---------20090808-120000.ogg

It's like this:

name----------YYYYMMDD-hhmmss.ogg

Now Im splitting these hourly files into 1 minute files. I get then this output sofar properly:

beach---------20090808-110000_00.mp3
beach---------20090808-110000_01.mp3
beach---------20090808-110000_02.mp3
and so on....

the 00, 01, 02 and up are the minutes it has splitted it. Now I need a script, after it did this, to rename the file names into this:

beach---------20090808-110000.mp3
beach---------20090808-110100.mp3
beach---------20090808-110200.mp3
beach---------20090808-110300.mp3

View 4 Replies


ADVERTISEMENT

General :: Rename Some Files To New Filenames In Ascending Format?

Dec 8, 2010

Fox example.I want to rename the files below like this: test1.png、test2.png.....

-rw-rw-r--. 1 test test 20448 2010-12-08 20:11 2010-12-08-212440_1440x900_scrot.png
-rw-rw-r--. 1 test test 29799 2010-12-08 21:25 2010-12-08-212526_369x331_scrot.png
-rw-rw-r--. 1 test test 34167 2010-12-08 23:54 2010-12-08-235424_580x328_scrot.png
-rw-rw-r--. 1 test test 155202 2010-12-08 23:55 2010-12-08-235511_1440x900_scrot.png

View 2 Replies View Related

OpenSUSE :: Renaming Long Filenames - Rename Command Not Working

Aug 9, 2010

I misused wildcards like a moron, in the rename command. I repeated names twice in a 3gig folder, which I cannot afford to delete. Now, the rename command is not working, and it says the file name is too long. I am a competent programmer in Java, PHP, and I know basic C.

View 7 Replies View Related

Programming :: Bash Script To Correct The Filenames

Apr 11, 2011

I have a directory that has a bunch of files and directories under it that I need to correct the filenames of. In fact, I plan on running this as a cronjob to keep checking filenames for certain characters. I want directories and filenames with spaces or pluses (+) to have those certain characters replaced with underscores (_). I know that this will involve sed but I'm not sure what else. A simple shell script would handle it.

View 1 Replies View Related

General :: Bash Scripting - Removing Strings From MP3 Filenames

Oct 5, 2010

I've been surfing and searching the net quit a while now to make my own script, but I haven't been really successful ever since I want to make a script which can remove strings from my mp3 collection (file names).

For example:
Code:
101-bob_sinclar_feat_sean_paul-tik_tok_(radio_edit).mp3 --> bob_sinclar_feat_sean_paul-tik_tok_(radio_edit).mp3
10-Young Jeezy-Lose My Mind (78 Bpm) (Repack).mp3 --> young_jeezy-lose_my_mind.mp3

Now the problem is how can I remove the strings like:
101 & 10 (dynamic)
(%%% Bpm) (dynamic)
(Repack) (static)

View 11 Replies View Related

General :: Appending File Extensions To Filenames In Bash Scripts?

May 18, 2010

Suppose I have a variable called filename which contains the name of a file but the name does not contain an extension.

View 4 Replies View Related

General :: Bash - Using Find Or Grep To Locate Filenames With Accented Characters From A Different Encoding System (Windows)

Dec 6, 2010

I tried to tag late onto a question similar to mine on stackoverflow (Find Non-UTF8 Filenames on Linux File System) to elicit further replies, with no luck so far, so here goes again... I have the same problem as the OP in the link above and convmv is a great tool to fix one's own filesystem. My question is therefore academic, but I find it unsatisfactory (in fact I can't believe) that 'find' is not able to find non standard ascii characters.

Is there anyone out there that would know what combination of options to use to find filenames that contain non standard characters on what seems to be a unicode FS, in my case the characters seem to be 8bits extended ascii rather than unicode, the files come from a Windows machine (iso-8859-1) and I regularly need to fetch them. I'd love to see how find and/or grep can do the same as convmv.

[Code]....

View 2 Replies View Related

Programming :: Fopen Bug In Filenames?

Aug 20, 2010

I try to call fopen with path like

Code: char *tmpbuf = (char*) malloc(BUFSIZE);
strcpy(tmpbuf, "/home/schmidt/images/4414b-22.jpg");
FILE *fd = fopen(tmpbuf, "rb"); or

[code]....

View 3 Replies View Related

Fedora :: Create Filenames Using The Date

May 5, 2010

I am currently working on a script which makes regular backups of some data I have, and I would like to name the compressed TAR files with the date it they were created, in short I want to rename a file:

OriginalName.tar.gz --> AnotherName-30-05-2010.tar.gz

Is there an easy way I can accomplish that? How?

View 14 Replies View Related

OpenSUSE :: Fix Invalid Filenames In Thunderbird

Jun 5, 2010

I want to travel for a while and need winfdows 7 for that. I want to copy my Linux Thunderbird profile with many years of emails across to windows7 then back to Linux when I'm finished with win 7. I copy the "profiles" folder at ~/.thunderbird/profiles folder over to win 7. Being thorough, I then run the windows app "chkdsk" to see if windows dislikes what I did in a filesystem context. Chkdsk finds three illegal filenames in the copied folder. The filenames contain colons.

They are as follows:
a directory named "mailbox:"
a directory named "mailbox:.sdb"
a file named "mailbox:.msf"

I try to manipulate them in windows (e.g. rename, delete, open, whatever) and get error messages about invalid names. It sounds to me like the items really are corrupt. So now I have a partially corrupted Thunderbird that works in Linux and doesn't work in windows and has years of emails in it. How do I straighten out Thunderbird in Linux? (I'll worry about windows later)

View 9 Replies View Related

General :: Listing Filenames Without The Directories?

Oct 3, 2010

list filenames one-per-line, in BASH without including directories. I think he was either wrong or making that up. There is a way to list just the names and one per line but there aren't any arguments I can find that can be used to exclude directories.

Code:

IFS=', '; files=`ls -m`; for i in $files; do if [ -f $i ]; then echo $i; fi; done That does only use ls as a command, however he said his GSI thought he could do it without all that...

Quote:

ricky@ricky-desktop:~$ ls -l
total 1376
drwxr-xr-x 2 ricky ricky 4096 2010-10-02 22:17 Azureus Downloads
drwxr-xr-x 4 ricky ricky 4096 2010-10-02 22:16 Desktop

[code]....

View 6 Replies View Related

General :: How To Sort Filenames Numerically

Oct 1, 2009

I am using Red hat linux .. i just wanted to know, is it possible to arrange or sort filenames numerically?i have saved several files with the follwing names : 1.png, 2.png, 3.png, 4.png ...... 11.png 12.png. and so on.... but the containing folder sorts this alphabetically in the following manner 11,12,13...... 1, 2, 3, and so on...

View 6 Replies View Related

General :: Read Mp3 Filenames From A Dir And Write Id3?

Nov 30, 2010

if i have a dir with several mp3's files:

example:

[root@xxx]ls -l
-rwxr-xr-x 1 web2 client1 6222573 Nov 26 17:34 01 Artist1 - Song1.mp3
-rwxr-xr-x 1 web2 client1 4989384 Nov 26 17:34 02 Artist2 - Song2.mp3
-rwxr-xr-x 1 web2 client1 6987438 Nov 26 17:36 03 Artist3 - Song3.mp3

and i need to update the id3 tag of all files with the command:

/usr/bin/id3v2 -a "Artist1" -t "Song1" Artist1 - Song1.mp3

how i do a loop to read the filename and execute the id3v2 command for each file, as i have filenames with spaces and special chars ex:"".

View 1 Replies View Related

Software :: Duplicated Filenames In The Same Directory?

Apr 3, 2011

The (WD 320GB) drive has a single ext3 FS on it. It has had some problems in the past, but all were fixed with fsck -y. Now there are several directories with duplicate filenames. The files with duplicated names are hard links of each other, but the names are identical. I've run several diagnostics over them, looking for, eg, non-printing characters in the name, but they are completely identical. Here are some examples:

[code]....

These are (obviously) from a directory of mp3s, but similar duplications occur throughout the fs - there are several thousand files affected. Some of the diagnostics were programmes I wrote that accessed the directory itself (through the dirent structure). I always thought duplicate filenames in the same directory were impossible in unix/linux; this appears to prove me wrong. Am I missing something? (Kernel version 2.4.20 with xfs extensions. The installation was originally Red Hat 7, but I've changed almost everything, so it's probably more accurate to call it a custom distro.)

View 7 Replies View Related

Software :: Remove Parenthesis From Filenames Using Sed?

Jun 8, 2010

I have filenames like such: abc (e).doc And I want to rename them to abc.doc I have a directory full of files names like this. How can i do this using the sed command? I have looked online for about 2-3 hours now and am frustrated that I can't find an answer.

View 11 Replies View Related

Programming :: Compare The Filenames Without Extensions?

Jan 3, 2009

I have a large number of files, all of them named /*/*.xyz I need to match them to potential files name /*/*.abc I have tried find -name *xyz |awk '// {print '$NF'}' | awk '{print $NF }' but the result has the full path I just need the filename without the extention, and without the full path.

View 5 Replies View Related

Fedora :: Change Certain Letters In Filenames To Uppercase?

May 22, 2010

I'm working on changing some badly named files, lots of them. I have a little script I use to change uppercase to lowercase:

[Code]....

Bear in mind all these files have appropriate numbers in the front of each filename. I need help to change ONLY the first letter after each underscore to an uppercase letter. I'm sure this can be done but I've done so much searching in forums and with Google/linux until I'm scrambled.

View 2 Replies View Related

General :: How To Use Rsync When Filenames Contain Double Quotes

Jan 29, 2011

I am trying to synchronize the content of the directory my_dir/ from /home to /backup. This directory contains a file which name has a double quote in it, such as to"to. Here is my rsync command:
rsync -Cazh /home/my_dir/ /backup/my_dir/

And I get the following message:
rsync: mkstemp "/backup/my_dir/.to"to.d93PZr" failed: Invalid argument (22)
For info, rsync works well when the synchronized filenames contain single quote, parenthesis and space. Thus, why is it bugging with a double quote?

View 3 Replies View Related

Ubuntu :: Type Spaces In Filenames In Terminal?

Mar 18, 2010

I'm trying to access a file and copy it to another location, but the drive name has a space. I'd like to rename that too.

I know that a % sign is sometimes used, but this didn't seem to work in terminal...

View 9 Replies View Related

Ubuntu :: Command To Remove Spaces From Filenames?

Aug 18, 2010

I have just switched to banshee as my media player and imported my films and music. Problem is, the video list is quite hard to read because all the video files have spaces in their names which are replaced by % signs, numbers and letters. I'm wondering if there is a command I can use in the directory that will automatically remove all the spaces from the filenames or better still, replace the spaces with hyphens or underscores?

View 6 Replies View Related

Ubuntu :: Cyrillic Filenames Corrupted After Crash

Nov 2, 2010

Everything was fine after fresh install of kubuntu 10.10 on my laptop, until today. I was exploring system settings (didn't change anything, just looking) when KDE crashed suddenly. After restart I found all my filenames with Russian letters corrupted - just like filesystem was mounted with wrong encoding. How can I get them back to normal?

View 1 Replies View Related

Ubuntu :: Unity Does Not Display Long Filenames On DVD?

May 14, 2011

I made a few data DVD's in OS/X 10.6.7 on my Macbook, using Burn URL...with the option "burn for PC and Mac".To my surprise when I load the DVD's in my ubuntu netbook, Unity displays the filenames abbreviated and renamed [COLOR="Navy"][U]. Some of the original filenames are similar, but unity restricts the filenames to about 22 ~ 50 characters.As such, I can't get a true (correct) file listing of the DVD's contents in Natty. I don't recall this happening with Karmic. Is this some problem with Nautilus?

FWIW, these were done using double layer 8.5 DVD-R disks. However, I did NOT select overburning, so the contents fit well into the allowed capacity, to permit inclusion of any hidden files.As soon as I load the disks on my Mac, I am able to see the full filename.

View 7 Replies View Related

Ubuntu :: Finding Windows-illegal Filenames?

Jun 18, 2011

I want to search a bunch of files in Ubuntu to find the ones that have file names which Windows won't allow. There is too many to do it manually.

View 1 Replies View Related

Ubuntu :: Backup - Files With Cyrilic Filenames

Jan 22, 2010

I'm writing a small script to automate the backup: Problem: within the folder structure there're files and folders with Cyrillic characters: Example (this is not for bucking up the mp3s; it's only an example):
[Code].....

View 2 Replies View Related

General :: Check If Filenames Are Lowers Case?

Feb 5, 2010

What would be the best way to verify files in a folder are all lower case and if a file is not lower case, output the filename to the screen.

View 11 Replies View Related

Server :: Logrotate For Logs That Change Filenames

Nov 26, 2010

Say that a certain server process generates log files and names them according to the current date; e.g.

server.nov-20.2010.log
server.nov-21.2010.log
server.nov-22.2010.log
server.nov-23.2010.log

i'd like to have logrotate compress the logs that are older than 3 days. Is this possible with logrotate, or do i just schedule a cron job to bzip everything under the folder older than 3 days?

View 1 Replies View Related

Software :: Create Iso Images With Long Filenames?

Jun 30, 2010

I have an old game, and I want to back up the disk because its old and a little scratched. I tried to use dd to record the disk, but it crashes with an "i/o error", which is strange because I can read the files on the cd without any problem.Luckily, I found all of the files from the disk already backed up on my hard drive. The problem is, when I create an iso image using mkisofs it abbreviates all of the filenames... which makes the game not... run. So how do I create an iso image with long filenames?

View 7 Replies View Related

Software :: Process Utf8 Text Of Filenames To Cp/ln?

Nov 6, 2010

I have a unicode utf8 file containing filenames. I wish to process them with very basic scripts but the unicode is an issue. A script to create symlinks to all the filenames and put them in a dir

Code:

#!/bin/bash
while read line
do
echo "${line}"

[code]...

Any special way to address the unicode filenames? The links do not come out right. I am using Mac OSX GNU bash 3.2.48.

View 1 Replies View Related

Software :: Remove Part Of Multiple Filenames?

Jan 19, 2011

hey all i have a folder with lots of random jpegs but they all have the words 'SOMETHINGRANDOM' in there name that i want to remove and i'm trying something like this but it just renames all the files to 'newname'? Code: for filename in *.jpg; do newname=`echo $filename | sed -e 's/SOMETHINGRANDOM//g'` mv $filename newname; done

View 9 Replies View Related

Programming :: Compare Two Filenames Including The Paths?

Jun 22, 2011

I am trying to compare two filenames including the paths. Basically if two paths are similar then my program wants to display message. So I need to check for if two pathnames are same in the sorce and destination. So I was trying for the code to compare tow filename sincluding "" and if the Parent FIle Path is found in the child file path then I need to displays ome message. I was trying to modify something like this:

#!/bin/ksh
# Sample script
file1="C:TextLatestArticleNews.txt"

[code]....

View 7 Replies View Related







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