Search found 23237 matches

by rednoah
Today, 08:41
Forum: Scripting and Automation
Topic: How do I read a file into a variable?
Replies: 21
Views: 405

Re: How do I read a file into a variable?

If you're testing in the format editor then you are confusing the actual value with the display file path.

You'll want to check if your regex pattern matches like so:

Format: Select all

{ "12345" ==~ /\d+/ }
by rednoah
Today, 03:57
Forum: Help and Support
Topic: Can I use a Microsoft Store purchase on Synology NAS?
Replies: 1
Views: 71

Re: license

Unfortunately, Microsoft Store / Mac App Store purchases do not include a standalone universal license. See FileBot Pricing Explained for details: Microsoft Store and Mac App Store purchases are not interchangeable and cannot be converted to a universal life-time license. Please avoid the Microsoft ...
by rednoah
Today, 03:51
Forum: Scripting and Automation
Topic: How do I read a file into a variable?
Replies: 21
Views: 405

Re: How do I read a file into a variable?

If you use Groovy Syntax › 4.6. Slashy string then you don't need to escape \ characters:

Groovy: Select all

/\d/

If you use ' or " then Groovy Syntax › 4.3.1. Escaping special characters is relevant:

Groovy: Select all

"\\d"
by rednoah
Yesterday, 19:08
Forum: Scripting and Automation
Topic: How do I read a file into a variable?
Replies: 21
Views: 405

Re: How do I read a file into a variable?

I need it to remain a "\." :?: Why? What are you trying to achieve? :!: / and \ cannot not be used as path separator in a file path. / and \ are notably interchangeable. You can do /. or \. and on Unix that would refer to the file system root, but on Windows it's just an invalid file path...
by rednoah
Yesterday, 16:52
Forum: Anything and Everything else
Topic: Alternative option to buy an application
Replies: 2
Views: 92

Re: Alternative option to buy an application

Paddle does support all the usual international payment methods (Credit Card, PayPal, Apple Pay, Google Pay, etc) but if you need payment methods specific to Belarus / Russia / any other single country then you're probably out of luck. :idea: Purchase FileBot with Crypto Currency is an option of las...
by rednoah
Yesterday, 07:31
Forum: Scripting and Automation
Topic: How do I read a file into a variable?
Replies: 21
Views: 405

Re: How do I read a file into a variable?

If it's just about sharing data, then csv() json() and friends will work best, but if you also need to share code / logic (in addition to the data that code is working with) then the How can I use the same format in both GUI and CLI? is of course the way to go. :idea: The @lines (compile-time pre-p...
by rednoah
Yesterday, 05:41
Forum: Scripting and Automation
Topic: How do I read a file into a variable?
Replies: 21
Views: 405

Re: How do I read a file into a variable?

So value.stripReleaseInfo() won't work, and need to pass a parameter? Yep, must pass a parameter: { '[ONe]_Ano_Hana_01_(1280x720)'.stripReleaseInfo(false) } That said, you're probably looking for the clean() method: { '[ONe]_Ano_Hana_01_(1280x720)'.clean() } Doesn't that make it more complicated wi...
by rednoah
Yesterday, 05:15
Forum: Episode / Movie Naming Scheme
Topic: Read external CSV / TSV / JSON / XML files
Replies: 0
Views: 165

Read external CSV / TSV / JSON / XML files

Read CSV / TSV table Read a lookup table from an external CSV or TSV file: csv('/path/to/table.tsv') e.g. use custom series names { def map = csv('/path/to/table.tsv') n.replace(map) } $ cat ~/table.tsv Deep Space 9 DS9 How I Met Your Mother HIMYM Read lines of text Read lines from a text file: lin...
by rednoah
Yesterday, 05:08
Forum: Scripting and Automation
Topic: How do I read a file into a variable?
Replies: 21
Views: 405

Re: How do I read a file into a variable?

Wolfie wrote: Yesterday, 05:02

Format: Select all

def configs=include "P:/FileBot/config.groovy"
If you're using include() just to create a structured data object for your configuration, then you definitely want to use json() (and convert your configuration file to JSON syntax) instead for this particular use case.
by rednoah
Yesterday, 05:04
Forum: Scripting and Automation
Topic: How do I read a file into a variable?
Replies: 21
Views: 405

Re: How do I read a file into a variable?

String.stripReleaseInfo(boolean strict) does exist. There is no parameterless method of that name though.
by rednoah
Yesterday, 05:01
Forum: Scripting and Automation
Topic: How do I read a file into a variable?
Replies: 21
Views: 405

Re: How do I read a file into a variable?

Split code into external *.groovy script files › External format @lines are FileBot-specific preprocessor instructions, i.e. you're effectively copy & pasting text files together, before passing the result as a whole to the Groovy compiler / interpreter that is completely unaware how the code c...
by rednoah
Yesterday, 04:21
Forum: Scripting and Automation
Topic: How do I read a file into a variable?
Replies: 21
Views: 405

Re: How do I read a file into a variable?

:idea: The file path / file extension does not matter. But the file must be a tab-separated / comma-separated / pipe-separated / semicolon-separated / etc text file. :idea: If you're reading in a complex configuration file (i.e. nested structure, values, lists, maps, etc) then you could use the json...
by rednoah
Yesterday, 03:16
Forum: Scripting and Automation
Topic: How do I read a file into a variable?
Replies: 21
Views: 405

Re: I got a new one for ya BlueNoah

You can use the csv() function to read a CSV / TSV file into a Map object.

e.g.
rednoah wrote: 15 Jul 2012, 09:03

Format: Select all

{
	def table = csv('/path/to/names.tsv')
	table[n] ?: n
}

Console Output: Select all

$ cat ~/names.tsv
Deep Space 9	DS9
How I Met Your Mother	HIMYM

Screenshot
by rednoah
22 Jul 2024, 14:56
Forum: macOS
Topic: extracting part of {folder}
Replies: 6
Views: 346

Re: extracting part of {folder}

File.getAt() will give you the n-th path component. f[-2] is Groovy syntax for calling that method. -2 means 2nd element counting from the end. f[-2] is thus the same as f.dir.name and folder.name.
by rednoah
22 Jul 2024, 11:09
Forum: macOS
Topic: extracting part of {folder}
Replies: 6
Views: 346

Re: extracting part of {folder}

:arrow: FileBot Groovy Expression Reference Documentation would be the entrance to the rabbit hole.


:idea: f.path is Groovy syntax for calling the File.getPath() function.
by rednoah
22 Jul 2024, 04:50
Forum: macOS
Topic: extracting part of {folder}
Replies: 6
Views: 346

Re: extracting part of {folder}

:idea: f.path will give you the entire file path.

:idea: folder.path will give you the folder path.

:idea: folder.name will give you the folder name.

:idea: You can do f.dir.name, f.dir.dir.name, f[0] , f[-2], etc to get individual path components.
by rednoah
22 Jul 2024, 04:20
Forum: Ubuntu & Desktop Linux
Topic: Have .filepart when amc script is copying movie to another directory?
Replies: 2
Views: 298

Re: AMC -copy

:idea: Processing files instantly within the same file system using hardlinks is most strongly recommended. You can then use other tools such as rsync to sync things to remote machines as needed. :idea: That said, you can have your own Custom Rename Action › Shell Actions if you must move files to a...
by rednoah
21 Jul 2024, 12:19
Forum: Feature Requests and Bug Reports
Topic: Any plans for an Asustor NAS app via App Center?
Replies: 2
Views: 367

Re: Any plans for an Asustor NAS app via App Center?

:idea: Asustor is confirmed to support docker:
https://www.asustor.com/solution/what_is_docker



:arrow: You should be able to run filebot-node and filebot-xpra to run filebot locally via a WebUI from a remote machine:
https://www.filebot.net/linux/docker.html
by rednoah
18 Jul 2024, 11:07
Forum: Feature Requests and Bug Reports
Topic: Any plans for an Asustor NAS app via App Center?
Replies: 2
Views: 367

Re: Any plans for an Asustor NAS app via App Center?

That hasn't really come up before... :?: Presumably, Asustor NAS is Linux-based and supports ssh and can thus already install and run filebot just fine? :?: Presumably, Asustor NAS has a WebUI for running docker containers ? :idea: We could certainly consider support for Asustor NAS. Perhaps also lo...
by rednoah
18 Jul 2024, 06:08
Forum: Ubuntu & Desktop Linux
Topic: How can i rename files based on history?
Replies: 12
Views: 700

Re: How can i rename files based on history?

:idea: src.duplicate(dst) will hardlink if possible, and copy if necessary.


:?: Are src and dst are on the same file system?


:?: What is that file system? (NOTE: if it's btrfs then src.duplicate(dst) might reflink)
by rednoah
17 Jul 2024, 09:39
Forum: Episode / Movie Naming Scheme
Topic: Including additions within a derive. Trailing chars missing on empty edition
Replies: 3
Views: 565

Re: Including additions within a derive. Trailing chars missing on empty edition

As a beginner, I would ask if you have any advice that would save me time from learning more lessons the hard way? This is my 3rd time restructuring my files due to learning more about Plex naming standards. I'd strictly stick to the Plex Naming Scheme . I see you're adding a {collection} folder. I...
by rednoah
17 Jul 2024, 09:17
Forum: Episode / Movie Naming Scheme
Topic: How to set naming to automatically move to kids folder based on rating?
Replies: 3
Views: 473

Re: How to set naming to automatically move to kids folder based on rating?

I was struggling with if statements in my Filebot format script. I saw an article on if statements. Is there an article you would recommend to ensure I understand which symbols mean what? I am unsure what ==~ means. Could you explain that? FileBot Groovy Expression Reference Documentation is a star...
by rednoah
17 Jul 2024, 04:11
Forum: Episode / Movie Naming Scheme
Topic: Including additions within a derive. Trailing chars missing on empty edition
Replies: 3
Views: 565

Re: Including additions within a derive. Trailing chars missing on empty edition

:idea: Learn how {expressions} work and useful Helper Functions will explain why you get no value when your top-level {...} expression fails, e.g. due to undefined variables. :idea: If you want to inject information into the {plex} binding then you will want to do it like so to allow for one of edit...
by rednoah
17 Jul 2024, 04:05
Forum: Episode / Movie Naming Scheme
Topic: How to set naming to automatically move to kids folder based on rating?
Replies: 3
Views: 473

Re: How to set naming to automatically move to kids folder based on rating?

What is the best way to automate a file being sent to a kids folder if it's a kids tv or movie? What params would I base it on? Ratings? FileBot can do anything, but FileBot cannot tell you what you want to do. Can filebot sort between children's/adult shows/movies? will help you get started. :idea...