renaming

Rename all files in a folder using batch

丶灬走出姿态 提交于 2019-12-20 07:37:04
问题 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 回答1: forfiles /m *.log /c "cmd /c ren @file @file06112010" 回答2: #!/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

a MYSQL script to convert the column names to lowercase

亡梦爱人 提交于 2019-12-18 13:36:08
问题 I am looking for a single MYSQL script to convert ALL column names in a database to lowercase in one go... I have inherited a MYSQL database that has a lot of mixed case column names (150 tables with a strange naming convention) and I don't want to go through manually each table by table to do this. Has anyone got such a script? Thanks 回答1: You can solve this task by building a script, starting with the output from this statement: SELECT table_name, column_name, data_type FROM information

Rename or refactor files in Xcode

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-17 17:42:30
问题 Is it possible to rename/refactor a class file and have it rename the actual file on disk? If so, how can I do this? 回答1: The safest way to rename files is to refactor the class name using Xcode's "Refactor" command . Using that command makes sure that your code is also updated anywhere that references the file or the class (including NIBs). Right-click on the class name in the interface ( .h ) file, choose Refactor->Rename , and Xcode will guide you through the process, allowing you to

Using variable value as column name in data.frame or cbind

大兔子大兔子 提交于 2019-12-17 16:27:39
问题 Is there a way in R to have a variable evaluated as a column name when creating a data frame (or in similar situations like using cbind)? For example a <- "mycol"; d <- data.frame(a=1:10) this creates a data frame with one column named a rather than mycol . This is less important than the case that would help me remove quite a few lines from my code: a <- "mycol"; d <- cbind(some.dataframe, a=some.sequence) My current code has the tortured: names(d)[dim(d)[2]] <- a; which is aesthetically

Change model name in rails easily

好久不见. 提交于 2019-12-13 15:59:05
问题 I'm going to need to change one of my model names. Is there anything out there that will replace every instance of the original model name in the controllers views and tests or do I have to do it all manually, page by page? 回答1: Check out RubyMine from JetBrains, they have some good refactoring tools for ruby. 回答2: You have to do all manually, page by page. If you have tests, they should give you clear indications of where it is still in use. 回答3: Netbeans has this feature, where you can give

Changing FileNames using RegEx and Recursion

我的梦境 提交于 2019-12-13 01:23:56
问题 I'm trying to rename files that my program lists as having "illegal characters" for a SharePoint file importation. The illegal characters I am referring to are: ~ # % & * {} / \ | : <> ? - "" What i'm trying to do is recurse through the drive, gather up a list of filenames and then through Regular Expressions, pick out file names from a List and try to replace the invalid characters in the actual filenames themselves. Anybody have any idea how to do this? So far i have this: (please remember,

How to Batch change file extensions within subfolders [duplicate]

六月ゝ 毕业季﹏ 提交于 2019-12-12 07:49:31
问题 This question already has answers here : How do I rename files in sub directories? (15 answers) Closed 5 years ago . 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

How to rename a folder the same as the filename of the first file inside that folder using Windows batch programming?

那年仲夏 提交于 2019-12-12 06:06:21
问题 I have a group of about 3,000 folders named XYZ-1 through XYZ-3000. Inside those folders are groups of image files and a description text file. Such as: Property123_0001.jpg Property123_0002.jpg Property123_0003.jpg ... Property123_0085.jpg Property123_0086.jpg Z_Description.txt The number of .jpg files differs in each folder, but there's always a single description file. Each directory's image files have a different name, for example `XYZ-1 might contain Property123, while XYZ-10 might

c# - Bypassing Windows Forms ClassName name creation to one of my own

走远了吗. 提交于 2019-12-12 02:24:44
问题 I need help to set a Windows Form window classname to one chosen by myself. Didn't find anything useful, so I ask here. I need this because an old C++ application DLL written by my brother(he has not the code any more) is using FindWindow method with classname to copy data. So i need rename the window class name the same as the old app to get my new app to work. Any Idea ? 回答1: Considering this could look as unanswered I found the solution yesterday. It's not possible to change Window

XSLT 1.0: rename elements with same content

六眼飞鱼酱① 提交于 2019-12-11 14:06:42
问题 It seemed like an easy task but I am totally stuck now. I have the following XML: <?xml version="1.0" encoding="UTF-8"?> <Items> <Item> <ITEM_CODE>ITEM_CODE</ITEM_CODE> <ITEM_NAME>ITEM_NAME</ITEM_NAME> <ITEM_ALTERNATE_NAME>ITEM_ALTERNATE_NAME</ITEM_ALTERNATE_NAME> <ITEM_CATEGORY_CODE>ITEM_CATEGORY_CODE</ITEM_CATEGORY_CODE> </Item> <Item> <ITEM_CODE>15031</ITEM_CODE> <ITEM_NAME>Outer Carton</ITEM_NAME> <ITEM_ALTERNATE_NAME/> <ITEM_CATEGORY_CODE>52401</ITEM_CATEGORY_CODE> </Item> <Item> <ITEM