Bash script to pad file names
What is the best way, using Bash, to rename files in the form: (foo1, foo2, ..., foo1300, ..., fooN) With zero-padded file names: (foo00001, foo00002, ..., foo01300, ..., fooN) ...
What is the best way, using Bash, to rename files in the form: (foo1, foo2, ..., foo1300, ..., fooN) With zero-padded file names: (foo00001, foo00002, ..., foo01300, ..., fooN) ...
I have a whole bunch of files with filenames using our lovely Swedish letters å å and ö. For various reasons I now need to convert these to an [a-zA-Z] range. Just removing anything outside this range is fairly easy. The thing that's causing me trouble is that I'd like to replace å with a, ö with o and so on. This is charset troubles a...
I am using virtual machines for development,but each time I need a new VM, I copy the file and create a new server, but I need a new name for the server to add it to our network. After renaming the server, the Sharepoint sites have many errors and do not run. ...
I have to rename a complete folder tree recursively so that no uppercase letter appears anywhere (it's C++ sourcecode, but that shouldn't matter). Bonus points for ignoring CVS and SVN control files/folders. Preferred way would be a shell script, since shell should be available at any Linux box. There were some valid arguments about det...
If I wish to simply rename a column (not change its type or constraints, just its name) in an SQL database using SQL, how do I do that? Or is it not possible? This is for any database claiming to support SQL, I'm simply looking for an SQL-specific query that will work regardless of actual database implementation. ...
I want to find a sql command or something that can do this where I have a table named tblFoo and I want to name it tblFooBar. However, I want the primary key to also be change, for example, currently it is: CONSTRAINT [PK_tblFoo] PRIMARY KEY CLUSTERED And I want a name change to change it to: CONSTRAINT [PK_tblFooBar] PRIMARY KEY CLU...
I chmod'ed the directory to 777, same with the directory contents. Still, I get a "permission denied" error. Does PHP throw this error if apache is not the group/owner, regardless of the file permissions? Here's the call that's failing: rename('/correct/path/to/dir/1', '/correct/path/to/dir/2'); ...
I need to change the capitalization of a set of files in a subversion working copy, like so: svn mv test.txt Test.txt svn mv test2.txt Test2.txt svn mv testn.txt Testn.txt ... svn commit -m "caps" How can I automate this process? Standard linux install tools available. ...
How do I do mv original.filename new.original.filename without retyping the original filename? I would imagine being able to do something like mv -p=new. original.filename or perhaps mv original.filename new.~ or whatever - but I can't see anything like this after looking at man mv / info mv pages. Of course, I could write a shell scri...
I have successfully been able to rename a table and drop all constraints on that table with foreign key relationships and build they all back up. However, now I am at a point where the PK_tblFoo exists in more than one place (when I transfer the table to another DB). Renaming the table does not rename the primary key. How would I cascad...
I continue to get this error: Object '%s' cannot be renamed because the object participates in enforced dependencies I need to find a script that will help me to find all the dependencies that there is with this table. I will need to drop them, rename, then bring them back. Thanks. SQL Server 2005 ...
i am using mysql (5.0.32-Debian_7etch6-log) and i've got a nightly running bulk load php (5.2.6) script (using Zend_DB (1.5.1) via PDO) which does the following: truncating a set of 4 'import' tables bulk inserting data into these 4 'import' tables (re-using ids that have previously been in the tables as well, but i truncated the whole...
Is there an easy way to rename a group of files already contained in a directory, using Python? Example: I have a directory full of *.doc files and I want to rename them in a consistent way. X.doc -> "new(X).doc" Y.doc -> "new(Y).doc" ...
pkzip25 -add=all -dir=current -silent -locale -exclude=DistData.zip -exclude=extract.bat -exclude=run.bat -exclude=pkzip25.exe -exclude=extracted.txt -exclude=zipped.txt -exclude=.\STORE DistData.zip *.* pkzip25 -view -directories DistData.zip >zipped.txt copy DistData.zip ..\BKX\DistData_1.zip CD\BKX rename DistData_1.zip DistData_2.zi...
Say I've got a generic vertical market application and I want to package it as two separate programs aaa.exe and bbb.exe. Is there any way to use the Delphi linker to create an EXE/DLL file that doesn't have the same name as the DPR? I can't just rename the file because I get this error bbb.exe - Unable to to locate component ...
I have a very common situation. I have a file, and I need to entirely overwrite that file with new contents. However, the original file is accessed on every page load (this is a web app), so it can't be missing for very long. A few ms is OK (though not ideal), a second is not OK. Right now I do this by writing a temp file to the same di...
I need to rename files names like this "transform.php?dappName=Test&transformer=YAML&v_id=XXXXX" to just this "XXXXX.txt" How can I do it? I understand that i need more than one "mv" command because they are at least 25000 files. Thanks! ...
Problem I want to securely delete a file in windows XP. Context I need to delete my input file securely once i have finished with it, at the moment i am over writing all the data with zero, this is messy as my temp folder becomes full of old files also the name of the files is a security issue, rather than just moving them to the recycl...
I have a directory full of files, some which have an ampersand in their names. I would like to rename all the files with ampersands and replace each ampersand with a plus (+). I am working with around 10k files. What would be the best method to do this? ...
How do I rename the file either before or after it gets uploaded? I just want to rename the filename, not the extension. $changeTXT = $_SESSION['username']; $uploaderName = strtolower($changeTXT); $changeTXT = strtolower($changeTXT); $changeTXT = ucfirst($changeTXT); $filelocation = $_POST['userfile']; $filename = $_POST['filename']; $m...