rename

How to rename duplicate lines with awk?

本小妞迷上赌 提交于 2021-02-19 07:01:52
问题 I have a file with 1 million lines and some lines are duplicate. I would like to rename the duplicate lines by appending "variant" + a number. The file is formatted as follows: I am a test line She is beautiful need for speed Nice day today I am a test line stack overflow is fun I am a test line stack overflow is fun I have more sentences I am a test line She is beautiful Speed for need stack overflow is fun Let's stop here Desired results: I am a test line She is beautiful need for speed

How to rename duplicate lines with awk?

北战南征 提交于 2021-02-19 07:01:51
问题 I have a file with 1 million lines and some lines are duplicate. I would like to rename the duplicate lines by appending "variant" + a number. The file is formatted as follows: I am a test line She is beautiful need for speed Nice day today I am a test line stack overflow is fun I am a test line stack overflow is fun I have more sentences I am a test line She is beautiful Speed for need stack overflow is fun Let's stop here Desired results: I am a test line She is beautiful need for speed

How to rename a file in Android knowing only its media content Uri

孤人 提交于 2021-02-18 21:00:43
问题 In Android Q the MediaStore.Files.FileColumns.DATA field has been deprecated, and may be null or apps may not have the rights to read it, therefore is there a way to rename the filename section (not the path) of a file using only its media content Uri? Until now the DATA field could be used to find the real path of a file from a known Uri, but since it has been deprecated then the idea is not to even try to find or resolve the real file path, and use only its content Uri. Consider that the

bash removing part of a file name

和自甴很熟 提交于 2021-02-15 11:01:24
问题 I have the following files in the following format: $ ls CombinedReports_LLL-*'('*.csv CombinedReports_LLL-20140211144020(Untitled_1).csv CombinedReports_LLL-20140211144020(Untitled_11).csv CombinedReports_LLL-20140211144020(Untitled_110).csv CombinedReports_LLL-20140211144020(Untitled_111).csv CombinedReports_LLL-20140211144020(Untitled_12).csv CombinedReports_LLL-20140211144020(Untitled_13).csv CombinedReports_LLL-20140211144020(Untitled_14).csv CombinedReports_LLL-20140211144020(Untitled

bash removing part of a file name

眉间皱痕 提交于 2021-02-15 11:01:11
问题 I have the following files in the following format: $ ls CombinedReports_LLL-*'('*.csv CombinedReports_LLL-20140211144020(Untitled_1).csv CombinedReports_LLL-20140211144020(Untitled_11).csv CombinedReports_LLL-20140211144020(Untitled_110).csv CombinedReports_LLL-20140211144020(Untitled_111).csv CombinedReports_LLL-20140211144020(Untitled_12).csv CombinedReports_LLL-20140211144020(Untitled_13).csv CombinedReports_LLL-20140211144020(Untitled_14).csv CombinedReports_LLL-20140211144020(Untitled

Rename multiple files while keeping the same extension on Linux

廉价感情. 提交于 2021-02-13 16:37:09
问题 I have 100s of files in a directory with the following naming convention. 00XYZCD042ABCDE20141002ABCDE.XML 00XYZCC011ABCDE20141002.TXT 00XYZCB165ABCDE20141002ABCDE.TXT 00XYZCB165ABCDE20141002ABCDE.CSV I want to rename these files using bash , awk , cut , sed , so that I get the output: XYZCD042.XML XYZCC011.TXT XYZCB165.TXT XYZCB165.CSV So basically, remove the first two 0s always, and then keep everything until ABCDE starts and then remove everything including ABCDE and keep the file

Rename multiple files while keeping the same extension on Linux

筅森魡賤 提交于 2021-02-13 16:35:47
问题 I have 100s of files in a directory with the following naming convention. 00XYZCD042ABCDE20141002ABCDE.XML 00XYZCC011ABCDE20141002.TXT 00XYZCB165ABCDE20141002ABCDE.TXT 00XYZCB165ABCDE20141002ABCDE.CSV I want to rename these files using bash , awk , cut , sed , so that I get the output: XYZCD042.XML XYZCC011.TXT XYZCB165.TXT XYZCB165.CSV So basically, remove the first two 0s always, and then keep everything until ABCDE starts and then remove everything including ABCDE and keep the file

Linux recursively replace periods for all directorys and all but last period for files with underscores

匆匆过客 提交于 2021-02-10 15:13:57
问题 I have the following command which recursively renames all the files/directory's to lowercase and replaces spaces with _. find . -iname "*" | rename 'y/A-Z/a-z/; s/ /_/g;' How do I extend it to remove all periods from directories and leave just the last period for files? So input would be: this.is.a.directory this.is.a.file.txt Output this_is_a_directory this_is_a_file.txt 回答1: You can do this using find in a while loop and using a regex to leave last DOT for files: while IFS= read -rd ''

Renaming Rows in gtsummary, tbl_regression/tbl_stack

半世苍凉 提交于 2021-02-10 14:33:01
问题 I am using gtsummary and have stacked tables for the outputs of 11 different models on top of one another using the tbl_regression and tbl_stack functions. I am looking to see how the odds ratios of one consistent independent variable change across different dependent variables of interest. When I print out the tbl_stack output, it gives me 11 repeated rows of the independent variable name of interest, instead of the name of the unique dependent variables I am interested in. Does anyone know

Renaming Rows in gtsummary, tbl_regression/tbl_stack

倖福魔咒の 提交于 2021-02-10 14:31:09
问题 I am using gtsummary and have stacked tables for the outputs of 11 different models on top of one another using the tbl_regression and tbl_stack functions. I am looking to see how the odds ratios of one consistent independent variable change across different dependent variables of interest. When I print out the tbl_stack output, it gives me 11 repeated rows of the independent variable name of interest, instead of the name of the unique dependent variables I am interested in. Does anyone know