jpmhouston / renamecommand Goto Github PK
View Code? Open in Web Editor NEWA ParsableArguments implementation for making minimal rename scripts in Swift
License: MIT License
A ParsableArguments implementation for making minimal rename scripts in Swift
License: MIT License
Hello, I came across your repo that promising me. This is the only one of its kind. But I can not understand how to customize the script for my need. I am still at the beginning of my studies in computer programming but I thought I was comfortable enough in Swift.
I would like to rename about 5000 files that have this scheme there:
"Randomtext randomtext randomtext 848484984984.txt" To rename them in "848484984984.txt".
So I thought I could apply this treatment here:
public func componentsSeparatedByStrings() -> String {
let separators = ["%20"]
let arrayName = separators.reduce([self]) { result, separator in
return result.flatMap { $0.components(separatedBy: separator) }
}.map { $0.trimmingCharacters(in: .whitespacesAndNewlines) } // ["RandomText, RandomText, RandomText, 848484984984"]
let newName = arrayName.last
return newName! //848484984984
}
Unfortunately I can only have this result in my terminal.
'RandomText Randomtext Randomtext 848484984984.txt ' not Renamed
Would you have the kindness to help me? I thank you in advance
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.