JREN.BAT v2.8 - Rename files/folders using regular expressions
Moderator: DosItHelp
-
- Posts: 3
- Joined: 19 Sep 2017 18:03
Re: JREN.BAT - Rename files/folders using regular expressions
Hello,
is there a way to remove japanese characters from filenames using jren?
Regards,
is there a way to remove japanese characters from filenames using jren?
Regards,
Re: JREN.BAT - Rename files/folders using regular expressions
This should be possible, but I haven't tested.
JREN works internally using JSCRIPT, which in turn uses Unicode. So you simply need to know the various Unicode code point ranges that correspond to Japanese characters, and then transform that into a regex square bracket character set expression. I'm pretty sure this list is incomplete, but it should get you started:
Perhaps you could simply remove all characters that are not ASCII, which would be much simpler to specify
or
Of course, nothing will work if the names consist of only Japanese characters, or it you end up with duplicate names when you remove the Japanese characters.
Dave Benham
JREN works internally using JSCRIPT, which in turn uses Unicode. So you simply need to know the various Unicode code point ranges that correspond to Japanese characters, and then transform that into a regex square bracket character set expression. I'm pretty sure this list is incomplete, but it should get you started:
Code: Select all
jren "[\u4E00-\u9FbF\u3040-\u309F\u30A0-\u30FF]" ""
Perhaps you could simply remove all characters that are not ASCII, which would be much simpler to specify
Code: Select all
jren "[^\u0000-\u007F]" ""
Code: Select all
jren "[^\x00-\x7F]" ""
Of course, nothing will work if the names consist of only Japanese characters, or it you end up with duplicate names when you remove the Japanese characters.
Dave Benham
-
- Posts: 3
- Joined: 19 Sep 2017 18:03
Re: JREN.BAT - Rename files/folders using regular expressions
Thanks a lot. Is there any difference between the last 2 command?
Re: JREN.BAT - Rename files/folders using regular expressions
The end result of the last 2 commands should be the same.
-
- Posts: 3
- Joined: 19 Sep 2017 18:03
Re: JREN.BAT - Rename files/folders using regular expressions
Hello again,
I have videos files with filenames:
.
where "andalotofstuff" is not necessarily the same in each file, and can include ".", "-", "[" and "]".
I also have subtitles files with filenames:
where "andotherstuff" is not necessarily the same in each file, and can include "(" and ")".
What i want is to rename "srt" files with the corresponding "mkv".
Some real examples are:
Note that not necessarily all video files has a corresponding subtitle file.
So, is there a way to do this with JREN? It doesn't mater if the solution has many steps.
I have videos files with filenames:
Code: Select all
Series.Name.S01E01.andalotofstuff.mkv
Series.Name.S01E02.andalotofstuff.mkv
Series.Name.S02E01.andalotofstuff.mkv
etc
where "andalotofstuff" is not necessarily the same in each file, and can include ".", "-", "[" and "]".
I also have subtitles files with filenames:
Code: Select all
Series Name 1x01 - Episode Name andotherstuff.srt
Series Name 1x02 - Episode Name andotherstuff.srt
Series Name 2x01 - Episode Name andotherstuff.srt
etc.
What i want is to rename "srt" files with the corresponding "mkv".
Some real examples are:
Code: Select all
Marvels.Agents.of.S.H.I.E.L.D.S05E04.720p.HDTV.x264-AVS[eztv].mkv
Marvel's Agents of S.H.I.E.L.D. 5x04 - A Life Earned (Español (Latinoamérica)).srt
The.Shannara.Chronicles.S02E08.720p.HDTV.x264-AVS[eztv].mkv
The Shannara Chronicles 2x08 - Amberle (Español (España)).srt
The.Shannara.Chronicles.S02E10.720p.HDTV.x264-KILLERS[eztv].mkv
The Shannara Chronicles 2x10 - Blood (English).srt
So, is there a way to do this with JREN? It doesn't mater if the solution has many steps.
Re: JREN.BAT - Rename files/folders using regular expressions
hi
i have 3000 file like this:
20170419171730.m2ts
20170419171730.m2ts.modd
20170419171730.m2ts.moff
i need to rename 2017* to 2018*
there is a way?
thanks
best regards
zorro
i have 3000 file like this:
20170419171730.m2ts
20170419171730.m2ts.modd
20170419171730.m2ts.moff
i need to rename 2017* to 2018*
there is a way?
thanks
best regards
zorro
Re: JREN.BAT - Rename files/folders using regular expressions
You could certainly do this with JREN but it is easy enough to do with a normal batch file. Just create a substring of the file name to remove the first 4 characters.
Re: JREN.BAT - Rename files/folders using regular expressions
A simple REN command works here:
Antonio
Code: Select all
C:\Users\Antonio\Documents\ASMB\Test
>dir /B
20170419171730.m2ts
20170419171730.m2ts.modd
20170419171730.m2ts.moff
C:\Users\Antonio\Documents\ASMB\Test
>ren 2017* 2018*
C:\Users\Antonio\Documents\ASMB\Test
>dir /B
20180419171730.m2ts
20180419171730.m2ts.modd
20180419171730.m2ts.moff
Re: JREN.BAT - Rename files/folders using regular expressions
sorry, but ren not work for me
I had already tried, but convert only the single extension files (.m2ts)
all other file are ignored (invisible - if i make dir the double extension file not show)
i used windows 7 pc
please can you help me?
thanks
best regards
I had already tried, but convert only the single extension files (.m2ts)
all other file are ignored (invisible - if i make dir the double extension file not show)
i used windows 7 pc
please can you help me?
thanks
best regards
Re: JREN.BAT - Rename files/folders using regular expressions
Did you saw my reply above? It is an example of the files and the command I used, copied directly from the screen. Such an example proves that my REN command correctly works, at least on my computer...
I suggest you to do exactly the same: create a few files, use the same REN command I used and then copy the screen contents and post it here (surrounded by [ code ] tags). Otherwise we have not idea of what are the files nor the command you used...
Antonio
I suggest you to do exactly the same: create a few files, use the same REN command I used and then copy the screen contents and post it here (surrounded by [ code ] tags). Otherwise we have not idea of what are the files nor the command you used...
Antonio
Re: JREN.BAT - Rename files/folders using regular expressions
thanks for reply
I managed to do only the printscreen thanks again
I managed to do only the printscreen thanks again
Re: JREN.BAT - Rename files/folders using regular expressions
@zorro101
Your .modd and .moff files have hidden or system attributes set. Most probably only hidden attribute as it seems from your screenshot.
If you want to restore the attributes after the rename operation, then before running the above code, first run
and take a note of the attributes, then after you've done with rename, do one of the following as appropriate
you can use /S switch with attrib to apply the attributes to all matching files in the current folder as well as subfolders in one shot, like:
Your .modd and .moff files have hidden or system attributes set. Most probably only hidden attribute as it seems from your screenshot.
Code: Select all
attrib -h *.m2ts.*
ren 2017* 2018*
Code: Select all
attrib *.m2ts.*
Code: Select all
attrib +h *.m2ts.*
attrib +s *.m2ts.*
attrib +h +s *.m2ts.*
Code: Select all
attrib -h -s *.m2ts.* /S