Add Commas to Make a Comma Separated Number

If you need help on how to use the program
Post Reply
DaveyMames
Posts: 4
Joined: 2020-07-19 02:53:15

Add Commas to Make a Comma Separated Number

Post by DaveyMames »

I use YouTube-DL to automatically download videos and add the view count of a video to give a filename like this:

Code: Select all

Video Title, Views 1920002564
Is there any setting I can use in Ant Renamer to add commas to the number in order to separate the number with commas like this?:

Code: Select all

1,920,002,564
Is there a way to have Ant Renamer separate the 11 last characters of the file name with commas but only if those characters are numbers?
antp
Site Admin
Posts: 9664
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Re: Add Commas to Make a Comma Separated Number

Post by antp »

Using regular expressions you achieve that. But you mention 11 last character, is it always 11? Or could it be less?
DaveyMames
Posts: 4
Joined: 2020-07-19 02:53:15

Re: Add Commas to Make a Comma Separated Number

Post by DaveyMames »

The end of a video title will always be like this except the number will be different based on the actual views the video got:

Code: Select all

View Amount 1920002564
11 characters is the max length that the views could be as it's in billions.
1 character is the minimum length the views could be.

So I would like Ant Renamer to add the thousands separator (commas) to the last 1-11 characters of the file name but only if those characters contain a number. How would I do that?
antp
Site Admin
Posts: 9664
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Re: Add Commas to Make a Comma Separated Number

Post by antp »

With the variable-length, I'm not sure it is possible using Ant Renamer.
Theoretically it seems possible using Regular Expressions, from what I find on internet, but what I found is not supported by the engine embedded in Ant Renamer and I don't see how to make it with what I know, sorry :/
(also sorry for the delay, but I was quite busy in the last few days)
DaveyMames
Posts: 4
Joined: 2020-07-19 02:53:15

Re: Add Commas to Make a Comma Separated Number

Post by DaveyMames »

What about if I had the views at the start of the filename like this:

Code: Select all

20200705 Views 1,454,321
Would it then be possible to have the views number seperated by commas?

That way the views amount will always start on the 16th character. The views number could be between 1-11 characters in length.
antp
Site Admin
Posts: 9664
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Re: Add Commas to Make a Comma Separated Number

Post by antp »

The problem is not really the position of the number, it is rather inserting a variable number of commas there.
Post Reply