trename - utility for renaming files
Project description
# trename - utility for renaming files
## Examples
```bash
> ls -1
16043_ACAGTG_R1_boston.txt
16045_ACTTGA_R1_boston.txt
16046_ATTCCT_R1_boston.txt
16047_ATGTCA_R1_boston.txt
16048_ATTCCT_R2_boston.txt
16050_GTGGCC_R2_texas.txt
16051_ACTGAT_R2_texas.txt
16052_ACAGTG_R2_texas.txt
> trename '{sample}_{readno}_{subid}.txt' '{sample}_{subid}_{readno}.txt' *.txt
> ls -1
16043_ACAGTG_boston_R1.txt
16045_ACTTGA_boston_R1.txt
16046_ATTCCT_boston_R1.txt
16047_ATGTCA_boston_R1.txt
16048_ATTCCT_boston_R2.txt
16050_GTGGCC_boston_R2.txt
16051_ACTGAT_boston_R2.txt
16052_ACAGTG_boston_R2.txt
```
## Installation
```bash
pip install https://github.com/lpenguin/trename/archive/master.zip
# or
git clone https://github.com/lpenguin/trename
cd trename
python setup.py install
```
## Getting help
```bash
> trename -h
usage: trename [-h] [-v] [-n] [-D] from_tpl to_tpl [files [files ...]]
positional arguments:
from_tpl template for old file name
to_tpl template for new file name
files files that will be renamed
optional arguments:
-h, --help show this help message and exit
-v, --verbose print old name and new name for each file
-n, --dry-run print names, do not actually rename
-D, --debug print debug information
```
## Examples
```bash
> ls -1
16043_ACAGTG_R1_boston.txt
16045_ACTTGA_R1_boston.txt
16046_ATTCCT_R1_boston.txt
16047_ATGTCA_R1_boston.txt
16048_ATTCCT_R2_boston.txt
16050_GTGGCC_R2_texas.txt
16051_ACTGAT_R2_texas.txt
16052_ACAGTG_R2_texas.txt
> trename '{sample}_{readno}_{subid}.txt' '{sample}_{subid}_{readno}.txt' *.txt
> ls -1
16043_ACAGTG_boston_R1.txt
16045_ACTTGA_boston_R1.txt
16046_ATTCCT_boston_R1.txt
16047_ATGTCA_boston_R1.txt
16048_ATTCCT_boston_R2.txt
16050_GTGGCC_boston_R2.txt
16051_ACTGAT_boston_R2.txt
16052_ACAGTG_boston_R2.txt
```
## Installation
```bash
pip install https://github.com/lpenguin/trename/archive/master.zip
# or
git clone https://github.com/lpenguin/trename
cd trename
python setup.py install
```
## Getting help
```bash
> trename -h
usage: trename [-h] [-v] [-n] [-D] from_tpl to_tpl [files [files ...]]
positional arguments:
from_tpl template for old file name
to_tpl template for new file name
files files that will be renamed
optional arguments:
-h, --help show this help message and exit
-v, --verbose print old name and new name for each file
-n, --dry-run print names, do not actually rename
-D, --debug print debug information
```
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
trename-0.1-py3.5.egg
(3.6 kB
view hashes)
trename-0.1-py2-none-any.whl
(3.3 kB
view hashes)
Close
Hashes for trename-0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72565524d2c07d6e9a8a1e7d70d70684352e414fa3f46016ccb3d97f26e53e5d |
|
MD5 | 54b4a202c2c18ba8090d6c92a41ecca1 |
|
BLAKE2b-256 | 96080eb756797c6164c3613cd7c14ae0f7dec3e4f5988be921935bd07180a512 |