Compare commits

...

2 Commits

Author SHA1 Message Date
f4fe30ce9f Added regex101.com to 'README.md'
Some checks reported errors
ydeng/renamebycsv/pipeline/head Something is wrong with the build of this commit
2023-04-25 10:40:00 -05:00
c84e0d8c4c Changed publish stage to use single quotes in sh step
All checks were successful
ydeng/renamebycsv/pipeline/head This commit looks good
2023-04-25 09:55:09 -05:00
2 changed files with 6 additions and 3 deletions

2
Jenkinsfile vendored
View File

@ -34,7 +34,7 @@ pipeline {
}
steps {
withCredentials([usernamePassword(credentialsId: 'rs-git-package-registry-ydeng', passwordVariable: 'PASS', usernameVariable: 'USER')]) {
sh "python -m twine upload --repository-url https://git.reslate.systems/api/packages/${USER}/pypi -u ${USER} -p ${PASS} --non-interactive --disable-progress-bar --verbose dist/*"
sh 'python -m twine upload --repository-url https://git.reslate.systems/api/packages/${USER}/pypi -u ${USER} -p ${PASS} --non-interactive --disable-progress-bar --verbose dist/*'
}
}
}

View File

@ -5,8 +5,10 @@ A simple program that renames files by using a spreadsheet in CSV format as a di
## Features
- Rename files recursively within a directory to a desired string
- Replace only the REGEX match portion
- Desired string is set by a CSV where one column is the original string, and another column is the string to replace the original string with
- Uses a REGEX capture group to select file and the portion of the filename to rename
- Ability to define file extension
## Installing using `pip`
@ -14,7 +16,6 @@ A simple program that renames files by using a spreadsheet in CSV format as a di
2. Run `renamebycsv -h` to see the help and confirm installation was successful.
## Advanced Usage: What is REGEX?
This program makes heavy use of REGEX, also known as Regular Expression to give users the flexibility to choose which portion of any given filename should be the portion used by the program to look up in the CSV. It is therefore critical for users of this script to understand how REGEX works. Here are some key pointers to get you started:
@ -28,4 +29,6 @@ This program makes heavy use of REGEX, also known as Regular Expression to give
Now for a few examples:
Let's say we have files `run325-a-1.vcf`, `run326-b-2.vcf`, and `run327-b-3.vcf`. If we know that all that matters is the `1` after the `run[numbers]-[character]-`, we can write `run\d+-\w-(\d).vcf` which will match with all 3 of the above examples, and select the last digit. The program can then use a given CSV to look up the selected digits and replace the name with what is given by the CSV.
Let's say we have files `run325-a-1.vcf`, `run326-b-2.vcf`, and `run327-b-3.vcf`. If we know that all that matters is the `1` after the `run[numbers]-[character]-`, we can write `run\d+-\w-(\d).vcf` which will match with all 3 of the above examples, and select the last digit. The program can then use a given CSV to look up the selected digits and replace the name with what is given by the CSV.
For learning and testing your own REGEX, checkout [regex101.com](https://regex101.com/), which allows you to write the strings that you're trying to match, and the REGEX. It will show you live which parts of the strings match to what, if any parts match.