String without file extension - VisualCron - Forum

Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


next1991
6 years ago
Hi,
how can i do a string without a file extension?

{STRING(Right|{LOOP(CurrentValueXLine)}|8)}
(it must be "Right", because the filename can have 10,11,12,.... characters)

xxxxxxxx_24012019.txt

Actually i got:
-> FOLDER_2019.txt\

I want...
-> FOLDER_24012019\

Thx
Sponsor
Forum information
next1991
6 years ago
Folder_{PATH(GetFileNameWithoutExtension|{STRING(Right|{LOOP(CurrentValueXLine)}|12)})}\

it works
thomas
6 years ago
Several ways to solve this:

1) You can use regex.

2) You can use IndexOf to give you first occurence of '_'. Then you use substring to find the next 8 characters.

3) You can use the Get column by row, column separator function. eg:

{STRING(GetColumn|1|2|_|xxxxxxxxxxxxxxx_20190123_xxxxxx.PDF)}

Row = 1. It uses '_' as column separator, and takes second occurence.
Support
6 years ago
There is a specific Variable for removing File extension. Example below:

{PATH(GetFileNameWithoutExtension|C:\Program Files (x86)\VisualCron\VisualCronClient.exe)}

Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Gary_W
6 years ago
For the sake of information, this regex will give the 1st captured group of 8 digits after the last underscore and before the ".txt" anchored to the end of the string:

{REGEX(MatchGetGroup|xxxxxxxx_24012019.txt$|_(\d{8})\.txt|1)}
Scroll to Top