Giter Site home page Giter Site logo

Comments (14)

nightson avatar nightson commented on June 19, 2024 1

@nightson Would specifying the each file name in the regular expression not achieve what you want?

$ f2 -f 'a.jpg|3.png|q.txt'

That would work if you only need to rename a few files. If F2 supports file lists it could be easily integrated with other tools like Candy (an AHK script).

from f2.

ayoisaiah avatar ayoisaiah commented on June 19, 2024

@nightson Would specifying the each file name in the regular expression not achieve what you want?

$ f2 -f 'a.jpg|3.png|q.txt'

from f2.

ayoisaiah avatar ayoisaiah commented on June 19, 2024

Thanks for the clarification @nightson , I will add this feature very soon

from f2.

nightson avatar nightson commented on June 19, 2024

Thanks for the clarification @nightson , I will add this feature very soon

Cool! Kudos to your hard work!

from f2.

ayoisaiah avatar ayoisaiah commented on June 19, 2024

@nightson Here's how it currently works:

You create a CSV file like this (the second column is optional)

coverage.out,cover.out
LICENCE,license
README.md,README
f2.exe,f2.msi

And pass it to the csv option:

$ f2 -csv 'input.csv'
+--------------+-----------+--------+
|    INPUT     |  OUTPUT   | STATUS |
+--------------+-----------+--------+
| coverage.out | cover.out | ok     |
| LICENCE      | license   | ok     |
| README.md    | README    | ok     |
| f2.exe       | f2.msi    | ok     |
+--------------+-----------+--------+

You can still use the -f and -r options but they will only operate on the paths in the CSV file.

from f2.

nightson avatar nightson commented on June 19, 2024

@nightson Here's how it currently works:

You create a CSV file like this (the second column is optional)

coverage.out,cover.out
LICENCE,license
README.md,README
f2.exe,f2.msi

And pass it to the csv option:

$ f2 -csv 'input.csv'
+--------------+-----------+--------+
|    INPUT     |  OUTPUT   | STATUS |
+--------------+-----------+--------+
| coverage.out | cover.out | ok     |
| LICENCE      | license   | ok     |
| README.md    | README    | ok     |
| f2.exe       | f2.msi    | ok     |
+--------------+-----------+--------+

You can still use the -f and -r options but they will only operate on the paths in the CSV file.

Cool! Could you also add an option that allows passing the paths directly in the command line?

from f2.

ayoisaiah avatar ayoisaiah commented on June 19, 2024

@nightson How do you mean?

from f2.

nightson avatar nightson commented on June 19, 2024

Something like this
f2 -p path1 path2 path3 -f -r

from f2.

ayoisaiah avatar ayoisaiah commented on June 19, 2024

You can do that already. Add the paths after all options

$ f2 -f -r path1 path2 path3

from f2.

nightson avatar nightson commented on June 19, 2024

Sorry I didn't make myself clear. I meant the paths to the files to rename. F2 only supports directory paths to search for currently if I'm not mistaken.

Like this:
$f2 -f -r -p "C:\1.txt" "C:\2.txt" "C:\3.txt"

from f2.

ayoisaiah avatar ayoisaiah commented on June 19, 2024

@nightson Ok I understand now. I've adapted the code so that it works with both directories and file paths, so you can use either or both.

$ f2 -f -r path1 path/2/file.txt path3

from f2.

nightson avatar nightson commented on June 19, 2024

@nightson Ok I understand now. I've adapted the code so that it works with both directories and file paths, so you can use either or both.

$ f2 -f -r path1 path/2/file.txt path3

Cool. That's an even better implementation! Thank you!

from f2.

ayoisaiah avatar ayoisaiah commented on June 19, 2024

@nightson Please upgrade to the latest release: https://github.com/ayoisaiah/f2/releases/tag/v1.7.0

from f2.

nightson avatar nightson commented on June 19, 2024

@nightson Please upgrade to the latest release: https://github.com/ayoisaiah/f2/releases/tag/v1.7.0

Works like a charm. Thank you!

from f2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.