laurent22 / massren Goto Github PK
View Code? Open in Web Editor NEWmassren - easily rename multiple files using your text editor
massren - easily rename multiple files using your text editor
I'm using Windows and tried to set the editor using this command:
massren --config editor "F:\Sublime Text 3\sublime_text.exe -n -w"
The command executes successfully, but when I try to launch massren, the following error occurs:
massren: Waiting for file list to be saved... (Press Ctrl + C to abort)
massren: exec: "F:\\Sublime": file does not exist
massren: Run 'massren --help' for usage
I'm guessing just wrapping the path in quotes here should solve the problem?
Currently, massren doesn't deal with already existing files and throws up an error:
massren: "/path/to/file" cannot be renamed to "/some/file": destination already exists
There could be multiple strategies for dealing with such cases:
For me, option # 1 is the most used one, but # 3 sounds sane too.
uhh yes, oh no
Doing ls I see \n
... I don't even know how they got in there.
If I run massren with no parameters, and save and exit my editor without making any changes, massren hangs indefinitely. Expected behavior is for it to quit.
Tested on Arch Linux 32-Bit.
EDIT: It still does respond to SIGINT
I'm guessing most of users of massren doesn't expect /n
like argument. I hope to change it to -n
on windows.
Thank you
Currently if a rename operation is invalid, massren do nothing and display error text
If possible, add an option like fix_invalid_filename
When it's false
, massren works like what it is now
When it's true
, fix common filename errors (maybe with more customizable setting like character used to replaced invalid characters)
For example
old name, user's edit, new name
---
1.h 1*.h 1_.h
2.h 1?.h 1_(1).h
3.h 2::2.h 2__2.h
Thanks for your repo!
I try to find application like this for years
BTW could you please update windows build to the lastest 1.4?
Hi,
Hope you're well
Thanks for software
When I process the contents of this folder the following file gets output at the bottom of the file list:
It's Always Sunny in Philadelphia - s04e07 - Who Pooped the Bed? 2008-10-09 - DVDRIP - SDTV-480p24 - XVID AC3.avi
Screen shot:
The oddity appears to be due to the question mark in the file name
Can this be fixed?
If you're reading this and:
a) agree, then please up-vote and/or reply +1, or;
b) disagree, then I'd love to know why?
If you have any issues (e.g. questions/queries) happy to help
Hope to hear back
Keep up great work!
Yours faithfully
hardware: Apple, MacBook Pro (Retina, 15-inch, Mid 2014)
software - operating system: macOS, v10.14 (18A391)
Simply put, it's annoying that every time I want to rename files, I am greeted with this enormous message about how to use the program, and would like for it to go away by default.
Plus, it can actually can be cumbersome to deal with because when I want to select something like the first column of text, I end up selecting a whole bunch of forward slashes and unneeded text.
I thought of 2 different ways of how to fix this issue:
I would think that the first option would be easier to implement. Just my 2 cents.
First of all, thank you for the great tool!
I've encountered undesirable behaviour:
(input)
$ ls
00.jpg 03.jpg 06.jpg 09.jpg 12.jpg 15.jpg 18.jpg 21.jpg 24.jpg 27.jpg 30.jpg 33.jpg 36.jpg 39.jpg
01.jpg 04.jpg 07.jpg 10.jpg 13.jpg 16.jpg 19.jpg 22.jpg 25.jpg 28.jpg 31.jpg 34.jpg 37.jpg
02.jpg 05.jpg 08.jpg 11.jpg 14.jpg 17.jpg 20.jpg 23.jpg 26.jpg 29.jpg 32.jpg 35.jpg 38.jpg
(then I do)
$ massren
...
// I want to shift numbering to start it from 01
01.jpg
02.jpg
...
40.jpg
(and get)
$ ls
40.jpg
Last time I've tried to submit it to the official Homebrew repository they didn't accept Golang applications, however it seems they don't have this restriction anymore, so it could be worth submitting it again.
I used to invoke with this syntax: massren .
. But it no longer works, it shows empty. I can leave the .
off and it'll work, but I don't know why .
fails as a path specification...?
For example, I use emacsclient -nw
to get an emacs frame from my emacs server in the current tty, but this fails because exec.Command
requires a straight executable path in the name
field. Fixing this will probably require some extra code in editFile at main.go:129, but I haven't used go enough to know the Right Thing to Do.
This is probably also required for #1.
Would be great to be able to override the [already] set editor temporarily.
(As I understand, now, the only possibility is to re-set the conf variable before launch, and then to restore it, which is sort of hectic :))
The default editor for a given file extension is stored in a registry key:
HKEY_CLASSES_ROOT/.txt/ShellNew/ItemName
It was set to this on my system as a string value
@%SystemRoot%\system32\notepad.exe,-470
See this
Are there any plans to support renaming a file with with a slash and it would create subfolders and move the files in?
/path1_subpath1_name.jpg
/path1/subpath1/name.jpg
Please switch to using go modules or else brew will no longer support massren.
See Homebrew/homebrew-core#47627
https://twitter.com/ldexterldesign/status/883099626747908096
NO REPLY NECESSARY
Hey,
Thanks for software - seriously cool project!
Hope you're well
ENHANCEMENT As a user I want (the option) to ignore file extensions so I don't have to create regex
To give some context: I keep a simple text file with my video TV series'[0], which I tend to scrape from https://thetvdb.com/ for Plex[1]; my personal video recorder software. If I didn't have to mess around with file extensions it would be even more trivial to copy/paste the contents of this text file into massren ๐
A simple regex solved my issue on this (first) occasion, but it would be nice to have an ignore option to fall back on if I have a mess of file extensions in future:
\.avi|mkv|mp4
If anyone else reading this agrees please up-vote or reply "+1"
Please let me know if there's a more suitable place to leave issues
Hope this is clear/useful
Yours faithfully
[0] Example TV series:
Curb Your Enthusiasm - s00e01 - Larry David: Curb Your Enthusiasm 1999-12-01
Curb Your Enthusiasm - s00e03 - Original Pilot
Curb Your Enthusiasm - s00e11 - It's Not A Reunion Show But It's The Closest You're Gonna Get 2009-09-08
Curb Your Enthusiasm - s00e21 - Interviews: Museum of Television and Radio, with Larry David
Curb Your Enthusiasm - s00e30 - Ricky Gervais Meets Larry David 2006-01-05
Curb Your Enthusiasm - s00e33 - Rebuilding the Seinfeld Sets 2010-06-10
Curb Your Enthusiasm - s00e34 - The Seinfeld Reunion: It Could Only Happen on Curb...
Curb Your Enthusiasm - s00e35 - Larry David as George Costanza 2010-06-10
Curb Your Enthusiasm - s00e36 - A Seinfeld Moment on Curb
Curb Your Enthusiasm - s01e01 - The Pants Tent 2000-10-15
Curb Your Enthusiasm - s01e02 - Ted and Mary 2000-10-22
Curb Your Enthusiasm - s01e03 - Porno Gil 2000-10-29
Curb Your Enthusiasm - s01e04 - The Bracelet 2000-11-05
Curb Your Enthusiasm - s01e05 - Interior Decorator 2000-11-12
Curb Your Enthusiasm - s01e06 - The Wire 2000-11-19
Curb Your Enthusiasm - s01e07 - AAMCO 2000-11-26
Curb Your Enthusiasm - s01e08 - Beloved Aunt 2000-12-03
Curb Your Enthusiasm - s01e09 - Affirmative Action 2000-12-10
Curb Your Enthusiasm - s01e10 - The Group 2000-12-17
Curb Your Enthusiasm - s02e01 - The Car Salesman 2001-09-23
Curb Your Enthusiasm - s02e02 - Thor 2001-09-30
Curb Your Enthusiasm - s02e03 - Trick or Treat 2001-10-07
Curb Your Enthusiasm - s02e04 - The Shrimp Incident 2001-10-14
Curb Your Enthusiasm - s02e05 - The Thong 2001-10-21
Curb Your Enthusiasm - s02e06 - The Acupuncturist 2001-10-28
Curb Your Enthusiasm - s02e07 - The Doll 2001-11-04
Curb Your Enthusiasm - s02e08 - Shaq 2001-11-11
Curb Your Enthusiasm - s02e09 - The Baptism 2001-11-18
Curb Your Enthusiasm - s02e10 - The Massage 2001-11-25
Curb Your Enthusiasm - s03e01 - Chet's Shirt 2002-09-15
Curb Your Enthusiasm - s03e02 - The Benadryl Brownie 2002-09-22
Curb Your Enthusiasm - s03e03 - Club Soda and Salt 2002-09-29
Curb Your Enthusiasm - s03e04 - The Nanny from Hell 2002-10-06
Curb Your Enthusiasm - s03e05 - The Terrorist Attack 2002-10-13
Curb Your Enthusiasm - s03e06 - The Special Section 2002-10-20
Curb Your Enthusiasm - s03e07 - The Corpse-Sniffing Dog 2002-10-27
Curb Your Enthusiasm - s03e08 - Krazee-Eyez Killa 2002-11-03
Curb Your Enthusiasm - s03e09 - Mary, Joseph and Larry 2002-11-10
Curb Your Enthusiasm - s03e10 - The Grand Opening 2002-11-17
Curb Your Enthusiasm - s04e01 - Mel's Offer 2004-01-04
Curb Your Enthusiasm - s04e02 - Ben's Birthday Party 2004-01-11
Curb Your Enthusiasm - s04e03 - The Blind Date 2004-01-18
Curb Your Enthusiasm - s04e04 - The Weatherman 2004-01-25
Curb Your Enthusiasm - s04e05 - The 5 Wood 2004-02-01
Curb Your Enthusiasm - s04e06 - The Car Pool Lane 2004-02-08
Curb Your Enthusiasm - s04e07 - The Surrogate 2004-02-22
Curb Your Enthusiasm - s04e08 - Wandering Bear 2004-02-29
Curb Your Enthusiasm - s04e09 - The Survivor 2004-03-07
Curb Your Enthusiasm - s04e10 - Opening Night 2004-03-14
Curb Your Enthusiasm - s05e01 - The Larry David Sandwich 2005-09-25
Curb Your Enthusiasm - s05e02 - The Bowtie 2005-10-02
Curb Your Enthusiasm - s05e03 - The Christ Nail 2005-10-09
Curb Your Enthusiasm - s05e04 - Kamikaze Bingo 2005-10-16
Curb Your Enthusiasm - s05e05 - Lewis Needs a Kidney 2005-10-30
Curb Your Enthusiasm - s05e06 - The Smoking Jacket 2005-11-06
Curb Your Enthusiasm - s05e07 - The Seder 2005-11-13
Curb Your Enthusiasm - s05e08 - The Ski Lift 2005-11-20
Curb Your Enthusiasm - s05e09 - The Korean Bookie 2005-11-27
Curb Your Enthusiasm - s05e10 - The End 2005-12-04
Curb Your Enthusiasm - s06e01 - Meet the Blacks 2007-09-09
Curb Your Enthusiasm - s06e02 - The Anonymous Donor 2007-09-16
Curb Your Enthusiasm - s06e03 - The Ida Funkhouser Roadside Memorial 2007-09-23
Curb Your Enthusiasm - s06e04 - The Lefty Call 2007-09-30
Curb Your Enthusiasm - s06e05 - The Freak Book 2007-10-07
Curb Your Enthusiasm - s06e06 - The Rat Dog 2007-10-14
Curb Your Enthusiasm - s06e07 - The TiVo Guy 2007-10-21
Curb Your Enthusiasm - s06e08 - The N Word 2007-10-28
Curb Your Enthusiasm - s06e09 - The Therapists 2007-11-04
Curb Your Enthusiasm - s06e10 - The Bat Mitzvah 2007-11-11
Curb Your Enthusiasm - s07e01 - Funkhouser's Crazy Sister 2009-09-20
Curb Your Enthusiasm - s07e02 - Vehicular Fellatio 2009-09-27
Curb Your Enthusiasm - s07e03 - The Reunion 2009-10-04
Curb Your Enthusiasm - s07e04 - The Hot Towel 2009-10-11
Curb Your Enthusiasm - s07e05 - Denise Handicapped 2009-10-18
Curb Your Enthusiasm - s07e06 - The Bare Midriff 2009-10-25
Curb Your Enthusiasm - s07e07 - The Black Swan 2009-11-01
Curb Your Enthusiasm - s07e08 - Officer Krupke 2009-11-08
Curb Your Enthusiasm - s07e09 - The Table Read 2009-11-15
Curb Your Enthusiasm - s07e10 - Seinfeld 2009-11-22
Curb Your Enthusiasm - s08e01 - The Divorce 2011-07-10
Curb Your Enthusiasm - s08e02 - The Safe House 2011-07-17
Curb Your Enthusiasm - s08e03 - Palestinian Chicken 2011-07-24
Curb Your Enthusiasm - s08e04 - The Smiley Face 2011-07-31
Curb Your Enthusiasm - s08e05 - Vow of Silence 2011-08-07
Curb Your Enthusiasm - s08e06 - The Hero 2011-08-14
Curb Your Enthusiasm - s08e07 - The Bi-Sexual 2011-08-21
Curb Your Enthusiasm - s08e08 - Car Periscope 2011-08-28
Curb Your Enthusiasm - s08e09 - Mister Softee 2011-09-04
Curb Your Enthusiasm - s08e10 - Larry vs. Michael J. Fox 2011-09-11
[1] https://support.plex.tv/hc/en-us/articles/200220687-Naming-Series-Season-Based-TV-Shows
I would like to work actively on the Windows release.
I currently have my semester exams coming up and would like to maintain the Windows release after that from December.
I don't see a license?
Currently, after launching the text editor, massren watches for the temporary file it created. If this file is modified, the renaming process starts, and then massren is closed.
However, if the file is not changed at all and simply closed, massren stays open and has to be closed with Ctrl + C.
In order to prevent this, we could watch the text editor process ID and, if it's gone, automatically exit massren. That would take care mainly of modal editors such as Vim. It still won't fix the issue with GUI editors though since they would usually remain open even if the file is closed.
This thing is smart, thanks!
I was wondering if you'd make it installable through brew
?
Iโve tried multiple variants like:
massren --config include_heder 0
massren --config include_heder=0
massren --config include_heder false
I get a message that te config has been changed and get a 0
exit code, but the header is still there when I run massren
.
Hi,
massren is so much part of my workflow that I though it was shipped with macOS/Linux ๐ ..
As I recently also got a windows workstation I wanted to voice for a bin release for windows :) (I did build it already for myself but I guess it would'nt hurt)
Requires chocolatey
I use Windows Terminal and PowerShell 7 but it works with other setups, mingw is required as go-trash
relies on gcc:
In an admin Terminal:
choco install -y golang mingw
Open a new terminal
go install "github.com/laurent22/[email protected]"
If you use vscode as the editor:
massren --config editor "code-insiders.cmd" # or code.cmd
Hi,
why do you use SQL to store configurations. Wouldn't JSON or INI work as well?
Would also remove the cgo deps.
Changing names to lowercase characters but keeping the same name does not work.
"/UPPERCASE NAME" cannot be renamed to "/uppercase name": destination already exists
Method 1: Type filenames directly via console
Method 2: Use send to
to send filenames to massren (by throw a shortcut to C:\Users\{Username}\AppData\Roaming\Microsoft\Windows\SendTo
)
Generated filename buffer from both methods above are different from the order in explorer, this cause problem for number renames
For example, I want to rename 1.txt
, 2.txt
...100.txt
to tvr016.cfg
, tvr017.cfg
...tvr115.cfg
If the order remains the same, column edition+number pattern start from 016 is enough to do so
But this can't be done since the order of file names in massren buffer is 1.txt
, 10.txt
, 100.txt
, 11.txt
...99.txt
which should be rename to tvr016.cfg
, tvr025.cfg
, tvr115.cfg
, tvr026.cfg
...tvr0114.cfg
, this can't be done with one rename pattern
I understand the need/want to support windows, so this will not work in all cases, but on systems where the EDITOR environment variable is set it seems to make sense to use that before trying to find an editor programmatically as it the default now.
This is the same strategy that git uses to find it's editor for commits and is fairly standard practice as far as I can tell.
@laurent22 Is this project abandoned?
For example, file names which are replaced with blank lines or some kind of flag ("DELETE_ME" etc) could be deleted rather than renamed. This would be useful for cleaning up messy directories, for example after extracting an archive in the wrong place. Could have a command line flag to turn this feature on.
I just used massren to mass-delete a bunch of files based on various filename filters, and it worked great, up until the part where it moved them all, one-by-one, to the OS X trash, complete with the sound effect for each one. On a list of about 10,000 files, this took more than 10 minutes.
An option to bypass the various operating system Trashes would be most welcome.
Hi all,
Hope you're well
Thanks for software
How would one go about renaming files recursively within a folder structure?
Since there's no features relating to this in the documentation I assume this isn't possible (yet) so I reached for (my limited) shell/bash knowledge:
find . -type d | xargs massren
Currently I only get an instance for the working directory but I expect a recursive instance per directory - can anyone make this useful?
Hope this is clear/useful and hope to hear back
Keep up great work!
Cheers
Mac Book Pro
OSX 10.7.5
zsh
$ curl -O https://raw.github.com/laurent22/massren/master/install/install.osx.sh
$ chmod 755 install.osx.sh
$ sudo ./install.osx.sh
Saving to: `massren.osx.tar.gz'
2014-02-18 17:29:45 (1.44 MB/s) - `massren.osx.tar.gz' saved [1149999/1149999]
x massren
$ massren --config editor subl
[1] 26970 segmentation fault massren --config editor subl
$ massren
[1] 27013 segmentation fault massren
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.