rename

Rename pdf file to be downloaded on fly

醉酒当歌 提交于 2019-12-21 02:46:26
问题 Given: All the uploaded pdf files on server are prefixed with timestamps. Later user can download these files again. These (ugly)filenames would never change again on server. Question: When I give the option to download PDF file, name of the file looks ugly and lengthy. How can I change this name to something sensible, so that when user downloads this file, name doesn't look weird? Do I need to make a copy, since renaming the original file is not an option? Wouldn't it be extra overhead for

git, sure-fire way to move/rename files while keeping the history

你离开我真会死。 提交于 2019-12-20 18:34:49
问题 I know there are "lots" of existing questions that looks similar, so let me summarize them before asking mine. The answer to Is it possible to move/rename files in git and maintain their history? is, "it is not possible". The conclusion for git moving file while keeping history is, Git may see it as a move, or it may still treat it as a delete + addition. The answer to the first one, I don't agree, because I've done that before. The answer to the second one is the reason why I'm asking this

copy tree with gradle and change structure?

牧云@^-^@ 提交于 2019-12-20 12:05:19
问题 Can gradle alter the structure of the tree while copying? original mod/a/src mod/b/src desired dest/mod-a/source dest/mod-b/source dest/mod-c/source I'm not sure where I should create a closure and override the copy tree logic I'd like to do the gradle equivalent of ant's globmapper functionality <property name="from.dir" location=".."/> <property name="to.dir" location="dbutil"/> <copy> <fileset dir="${from.dir}" ... /> <globmapper from="${from.dir}/*/db" to="${to.dir}"/> </copy> Thanks

Rename files to lowercase in Powershell

五迷三道 提交于 2019-12-20 09:49:52
问题 I am trying to rename a bunch of files recursively using Powershell 2.0. The directory structure looks like this: Leaflets + HTML - File1 - File2 ... + HTMLICONS + IMAGES - Image1 - Image2 - File1 - File2 ... + RTF - File1 - File2 ... + SGML - File1 - File2 ... I am using the following command: get-childitem Leaflets -recurse | rename -newname { $_.name.ToLower() } and it seems to rename the files, but complains about the subdirectories: Rename-Item : Source and destination path must be

Rename files using regular expression in linux

北城以北 提交于 2019-12-20 08:27:21
问题 I have a set of files named like: Friends - 6x03 - Tow Ross' Denial.srt Friends - 6x20 - Tow Mac and C.H.E.E.S.E..srt Friends - 6x05 - Tow Joey's Porshe.srt and I want to rename them like the following S06E03.srt S06E20.srt S06E05.srt what should I do to make the job done in linux terminal? I have installed rename but U get errors using the following: rename -n 's/(\w+) - (\d{1})x(\d{2})*$/S0$2E$3\.srt/' *.srt 回答1: You forgot a dot in front of the asterisk: rename -n 's/(\w+) - (\d{1})x(\d{2}

Rename all files in a folder using batch

て烟熏妆下的殇ゞ 提交于 2019-12-20 07:37:09
问题 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

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

Extract names of dataframe in list of dataframes and add it to columnnames

末鹿安然 提交于 2019-12-20 07:17:11
问题 I have a list of dataframes: set.seed(23) date_list = seq(1:30) testframe = data.frame(Date = date_list) testframe$ABC = rnorm(30) testframe$DEF = rnorm(30) testframe$GHI = seq(from = 10, to = 25, length.out = 30) testframe$JKL = seq(from = 5, to = 45, length.out = 30) testlist = list(testframe, testframe, testframe) names(testlist) = c("df1464", "df6355", "df94566") I want now to extract the name of each dataframe and add it to its columns. So the columnnames of the first dataframe in the

Mysql Rename Multiple tables with a pattern

不问归期 提交于 2019-12-20 06:00:04
问题 I know how to run RENAME TABLE onetable_test TO onetable; But is there a method to rename many tables with a pattern and don't write a lot of code like RENAME TABLE onetable_test TO onetable; RENAME TABLE twotable_test TO twitable; RENAME TABLE threetable_test TO threetable; ... I am using mysql. Thanks! 回答1: Use below stored procedure :: DELIMITER $$ CREATE PROCEDURE `Rename_Tables`() BEGIN DECLARE done INT DEFAULT FALSE; DECLARE tableName VARCHAR(50); DECLARE newTableName VARCHAR(70);

Mysql Rename Multiple tables with a pattern

我怕爱的太早我们不能终老 提交于 2019-12-20 05:59:01
问题 I know how to run RENAME TABLE onetable_test TO onetable; But is there a method to rename many tables with a pattern and don't write a lot of code like RENAME TABLE onetable_test TO onetable; RENAME TABLE twotable_test TO twitable; RENAME TABLE threetable_test TO threetable; ... I am using mysql. Thanks! 回答1: Use below stored procedure :: DELIMITER $$ CREATE PROCEDURE `Rename_Tables`() BEGIN DECLARE done INT DEFAULT FALSE; DECLARE tableName VARCHAR(50); DECLARE newTableName VARCHAR(70);