renaming

Weird behaviour in PowerShell bulk file renaming

限于喜欢 提交于 2019-12-05 16:36:59
I'm new to PowerShell and recently I try to rename 120 files in a folder and I encounter a weird behavior. What I have is files with named from 0001.txt, 0002.txt, ... 0120.txt a total of 120 files. I want to add an 'a' in front of each of the file name. I came up with this command: ls | ren -newname {$_.name -replace '(\d+)','a$1'} But after execution, I get numerous error like this: "The specified path, file name, or both are too long. The fully qualified file name must be less than 260" And when I look into my folder, all I get are file names from aaaaaaaaaaaaaaaaaaaaaaaaa(repeat until it

How to rename Java packages without breaking Subversion history?

自闭症网瘾萝莉.ら 提交于 2019-12-05 11:07:07
问题 The company I'm working for is starting up and they changed their name in the process. So we still use the package name com.oldname because we are afraid of breaking the file change history, or the ancestry links between versions, or whatever we could break (I don't think I use the right terms, but you get the concept). We use: Eclipse, TortoiseSVN, Subversion I found somewhere that I should do it in many steps to prevent incoherence between content of .svn folders and package names in java

Find and replace Android studio

一个人想着一个人 提交于 2019-12-04 07:23:57
问题 Is there a way to find and replace all occurrences of a word in an entire project( not just a single class using refactor -> rename) and also maintain case, either in android studio or using a command line script? For example, Supplier has to go to Merchant, supplier -> merchant, SUPPLIER -> MERCHANT. My boss wants me to change all instances of supplier with merchant for a project im working on. Ive been doing it for about an hour and i know im wasting my time. Let me know of any time saving

How to rename Java packages without breaking Subversion history?

若如初见. 提交于 2019-12-03 23:18:18
The company I'm working for is starting up and they changed their name in the process. So we still use the package name com.oldname because we are afraid of breaking the file change history, or the ancestry links between versions, or whatever we could break (I don't think I use the right terms, but you get the concept). We use: Eclipse, TortoiseSVN, Subversion I found somewhere that I should do it in many steps to prevent incoherence between content of .svn folders and package names in java files: First use TortoiseSVN to rename the directory, updating the .svn directories. Then, manually

How to Batch change file extensions within subfolders [duplicate]

南楼画角 提交于 2019-12-03 12:22:26
This question already has answers here : How do I rename files in sub directories? (15 answers) I am very new to Command Prompt, and only started using it as of 1 day ago. I have a folder in a location, for example C:\Users\Administrator\Desktop\Images , and inside that folder there is roughly 650 sub-folders, each containing around 20 images, a mix of JPG's and PNG's. I am looking for a command line for CMD which will go through all sub folders and change each .png file into a .jpg file. I have done a little research and found some information, however it is very hard to follow and understand

Rename (or remove prefix) multiple files to each ones number

懵懂的女人 提交于 2019-12-03 04:25:22
问题 I am trying to change all the files names in a current folder and I am trying to achieve this either by removing the files prefix (every file has a common prefix) or changing their names to their count (if there are 5 files, the filenames will be 1.txt 2.txt 3.txt 4.txt 5.txt). Now I have found the ren command in cmd and played with it a little but so far I was not able to achieve the result and I can only run this in cmd, so no batch files can be used. This is the closest that I got, but it

Rename (or remove prefix) multiple files to each ones number

怎甘沉沦 提交于 2019-12-02 18:45:38
I am trying to change all the files names in a current folder and I am trying to achieve this either by removing the files prefix (every file has a common prefix) or changing their names to their count (if there are 5 files, the filenames will be 1.txt 2.txt 3.txt 4.txt 5.txt). Now I have found the ren command in cmd and played with it a little but so far I was not able to achieve the result and I can only run this in cmd, so no batch files can be used. This is the closest that I got, but it only adds a prefix: FOR %f IN (*.*) DO ren %f prefix%f I have tried doing the opposite: FOR %f IN (*.*)

Find and replace Android studio

旧街凉风 提交于 2019-12-02 13:53:57
Is there a way to find and replace all occurrences of a word in an entire project( not just a single class using refactor -> rename) and also maintain case, either in android studio or using a command line script? For example, Supplier has to go to Merchant, supplier -> merchant, SUPPLIER -> MERCHANT. My boss wants me to change all instances of supplier with merchant for a project im working on. Ive been doing it for about an hour and i know im wasting my time. Let me know of any time saving suggestions. Krylez I think the shortcut that you're looking for is: Ctrl + Shift + R on Windows and

Rename all files in a folder using batch

微笑、不失礼 提交于 2019-12-02 10:00:49
I would like to create a batch file to rename all the files with extension ".log" in a folder to append with today's date. For example : App.log will be appended to App.log06112010 where date is 06112010. Please suggest forfiles /m *.log /c "cmd /c ren @file @file06112010" #!/usr/bin/ksh export TODAYSDATE=`date "+%m%d%Y"` umask 000 for filename in $1 do if [ ! -f $1 ]; then echo "$filename doesn't exist!" else if [ -d $1 ]; then echo "Skipping directory $filename..." else mv $filename $filename$TODAYSDATE fi fi done Usage: move.sh "*.log" 来源: https://stackoverflow.com/questions/3026007/rename

Renaming HTML files using <title> tags

无人久伴 提交于 2019-12-01 13:17:34
问题 I'm a relatively new to programming. I have a folder, with subfolders, which contain several thousand html files that are generically named, i.e. 1006.htm, 1007.htm, that I would like to rename using the tag from within the file. For example, if file 1006.htm contains Page Title , I would like to rename it Page Title.htm. Ideally spaces are replaced with dashes. I've been working in the shell with a bash script with no luck. How do I do this, with either bash or python? this is what I have so