file-rename

Rename files using bash script

◇◆丶佛笑我妖孽 提交于 2019-12-08 06:46:33
I have a bash script set that executes in a folder containing a number of photos and sequentially stitches them into panoramas based on the user input. Once the generation is completed, the output file is renamed to $x-pano.jpg and moved one folder higher. My issue is the number prefix is based on the sequential execution of the script, meaning all files get renamed 1-pano.jpg to n-pano.jpg based on the number of panoramas generated during the script execution. How can I modify the renaming process to look at the storage folder and get the largest $x ? I want to increment that number by 1 and

Rename image file on upload php

与世无争的帅哥 提交于 2019-12-06 10:53:15
问题 I have a form for uploading image. The index.html submits data to resizer.php. The coding is as follows; index.html <form action="resizer.php" method="post" enctype="multipart/form-data"> Image: <input type="file" name="file" /> <input type="submit" name="submit" value="upload" /> </form> resizer.php <?php require_once('imageresizer.class.php'); $imagename = "myimagename"; //Path To Upload Directory $dirpath = "uploaded/"; //MAX WIDTH AND HEIGHT OF IMAGE $max_height = 100; $max_width = 100; /

How to move files in the FTP server

只谈情不闲聊 提交于 2019-12-06 07:36:38
I want move files from a FTP server to another directory in the same server. I think the method that I have to use is Rename . Well, I can't continue because i don't know how. In put or get operations there are data stream but not here, that's my problem $ftprequest = [System.Net.FtpWebRequest]::create($Source) $ftprequest.Credentials = New-Object System.Net.NetworkCredential($user,$pass) $ftprequest.Method = [System.Net.WebRequestMethods+Ftp]::Rename $ftpresponse = $ftprequest.GetResponse() Use FtpWebRequest.RenameTo property to specify the target name (path): $ftprequest.Method = [System.Net

Batch rename issue when dealing with special characters in the filename

被刻印的时光 ゝ 提交于 2019-12-06 07:27:50
I have several hundred *.mp3 files in c:\files. There are all imaginable filenames in there like milad.mp3 (good behaving) hey you.mp3 (space in filename) systemofadown.mp3 (long filename) howdy(1).mp3 (parentheses in filename) and any combination of the last three conditions. I want to rename the files to 001-test.mp3, 002-mp3, ... It doesn't matter which file gets which name. have written a batch file to do the rename. Here is my code (with line numbers added): 01 rem @echo off 02 cls 03 set _number=%1 04 lfnfor on 05 06 :F1TO10 07 IF NOT EXIST *.mp3. goto end 08 if %_number% gtr 9 goto

Script to rename files

点点圈 提交于 2019-12-06 04:29:12
问题 I have about 2200 different files in a few different folders, and I need to rename about about 1/3 of them which are in their own subfolder. Those 700 are also in various folders as well. For example, there might be The top-most folder is Employees, which has a few files in it, then the folder 2002 has a few, 2003 has more files, 2004 etc. I just need to attach the word "Agreement" before the existing name of each file. So instead of it just being "Joe Schmoe.doc" It would be "Agreement Joe

Rename multiple files from command line [duplicate]

…衆ロ難τιáo~ 提交于 2019-12-06 01:40:53
This question already has answers here : Closed 6 years ago . Possible Duplicate: Renaming lots of files in Linux according to a pattern I have multiple files in this format: file_1.pdf file_2.pdf ... file_100.pdf My question is how can I rename all files, that look like this: file_001.pdf file_002.pdf ... file_100.pdf I know you can rename multiple files with 'rename', but I don't know how to do this in this case. You can do this using the Perl tool rename from the shell prompt. (There are other tools with the same name which may or may not be able to do this, so be careful.) rename 's/(\d+)

file renaming problem?

早过忘川 提交于 2019-12-05 04:50:55
Renaming a file in c#: File.Move(source,Destination); File.Delete(source); It execute successfully, how ever when i try to rename the file again, the system gives this exception: The process cannot access the file because it is being used by another process. i cant find that where is this in use? when i further debug the error it shows me the class name is in the process of w3wp.exe which is IIS. What should i do next? getting foreach (string folder in folder) { FileSystemItem item = new FileSystemItem(); DirectoryInfo di = new DirectoryInfo(folder); item.Name = di.Name; item.FullName = di

Rename files sequentially in python

十年热恋 提交于 2019-12-04 20:01:51
Hi i'm trying to rename my files in a directory from (test.jpeg, test1.jpeg, test2.jpeg etc...) (People-000, People-001, People-002 etc...) but I haven't found a good way to do that anywhere online. I'm kinda new to python but if I figured this out it would be very useful. If you don't mind correspondence between old and new names: import os _src = "/path/to/directory/" _ext = ".jpeg" for i,filename in enumerate(os.listdir(_src)): if filename.endswith(_ext): os.rename(filename, _src+'People-' + str(i).zfill(3)+_ext) But if it is important that ending number of the old and new file name

Bash command to remove leading zeros from all file names

泄露秘密 提交于 2019-12-04 12:15:44
问题 I have a directory with a bunch of files with names like: 001234.jpg 001235.jpg 004729342.jpg I want to remove the leading zeros from all file names, so I'd be left with: 1234.jpg 1235.jpg 4729342.jpg I've been trying different configurations of sed, but I can't find the proper syntax. Is there an easy way to list all files in the directory, pipe it through sed, and either move or copy them to the new file name without the leading zeros? 回答1: for FILE in `ls`; do mv $FILE `echo $FILE | sed -e

How can I get the original capture timestamp from my home movie files:: AVI and MPG4?

北战南征 提交于 2019-12-04 11:37:28
问题 I have over a TB of home movies with horrible file names. Finding what you want is impossible. I would like to rename all files to the time they were originally recorded (not the file time they were placed on my computer). Some applications (like Ulead Video Studio) can access this information, which I believe is embedded in the CODEC. I would LOVE to find how how either I can write a .Net app to extract this information to rename my files so I can easily organize them OR find an application