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
ADVERTISEMENT
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
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
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
View Related
May 6, 2011
Is there any method for placing translations in parenthesis at first occurrence? I need something similar to the acronym package, but instead, storing translations and printing brackets only after the first occurrence.
E.g. (pseudo-code):
Results in:
Do you like to eat bananas (xiangjiao)? No I don't like to eat bananas.
View 4 Replies
View Related
Mar 24, 2011
In C++ language, we can do the following compound tests,
Code:
std::string a, b, c, d;
if ((a == "Yes" && b == "Yes" ) || (c == "Yes" && d == "Yes")) { ... }
In bash scripts, how can we do the parenthesis around compound tests?
Code:
if [ "$a" = "Yes" ] && [ "$b = "Yes" ] [ "$c" = "Yes" ] && [ "$d" = "Yes" ]; then
...
fi
View 4 Replies
View Related
Aug 30, 2010
I have a file with several parentheses, both () and []. All of them should be closed, but apparently, one of them is open. In order to run a program, I need all of them to be closed... For example, if I write: ((bla (bla (bla)) I would have two parentheses missing. That's what I mean. But I have several parentheses in the file... it would take me ages to do it manually. Is there a way to check which parenthesis is open? can it be done?
View 5 Replies
View Related
Aug 4, 2010
Delete this with maximum prejudice, mods.
View 1 Replies
View Related
Dec 5, 2010
When I see a typical reference to a Unix manual, it often follows by a number surrounded by parentheses. For instance syslog.conf (5). I am sure this means something, but Googling it is impossible.
View 4 Replies
View Related
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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