Page 1 of 1

Enhancing the filename for the split filter?

Posted: Wed Dec 30, 2009 2:49 am
by dfhtextpipe
It would be a useful enhancement if other variables could become available to use within Split Filename.

The help for the Split filter states....

Split Filename

If you wish, you can control the names of the output files. All names are based on the input filename, in the input filename's folder. If you wish to control the output path, you MUST use the output filter.

Code: Select all

Macro name          Use
%f                  The input file's filename e.g. 'readme'
%e                  The input file's extension without any period e.g. 'txt'
%d                  The split file counter, starting from 0.
%3.3d               The split file counter, starting from 0, formatted in a field 3 wide with leading zeros.
%5.5d               The split file counter, starting from 0, formatted in a field 5 wide with leading zeros.
%x                  The split file counter in hexadecimal.
One suggestion would be to also permit as valid syntax the matching pattern (providing it is stripped of any invalid filename characters).
Another would be to use any global variable as part of the split Filename.

Suppose I have a text file for a whole Bible, and wish to split it into 66 separate files, using a suitable pattern.

Suitable split filenames might be

01_Gen_XXX.usfm
02_Exo_XXX.usfm
...
66_Rev_XXX.usfm

Clearly the first two characters can be generated by %2.2d
The characters "_XXX.usfm" can either be fixed, or the XXX part derived from the input filename.
But the booknames could best be derived from the split pattern.

Please review this suggestion and advise. Thanks.

Re: Enhancing the filename for the split filter?

Posted: Fri Jan 08, 2010 9:45 am
by DataMystic Support
Hi there,

At this stage we can easily add the inclusion of a global variable to the filename. Would this suffice for now?

Re: Enhancing the filename for the split filter?

Posted: Sun Jan 10, 2010 2:38 am
by dfhtextpipe
Let's try it and see! Thanks.

David

Re: Enhancing the filename for the split filter?

Posted: Wed Feb 24, 2010 5:01 am
by dfhtextpipe
You broke the existing code! See my new issue.

Re: Enhancing the filename for the split filter?

Posted: Thu Feb 25, 2010 6:20 pm
by dfhtextpipe
As you have abandoned using environment variables as a potential solution to this desired enhancement,
can you think of any better way to implement the original concept?

i.e. By a new macro, perhaps?

Re: Enhancing the filename for the split filter?

Posted: Mon Mar 01, 2010 5:51 am
by DataMystic Support
Yes - I think an @macro would work nicely. Need to check...

Re: Enhancing the filename for the split filter?

Posted: Sat Mar 06, 2010 7:46 pm
by dfhtextpipe
Simon,

Where do I find the beta you referred to in your email? I could not see a "beta" in the secure area.

David

Re: Enhancing the filename for the split filter?

Posted: Tue Mar 09, 2010 8:58 am
by DataMystic Support
Sorry, you only have the Standard version. You can review the Beta of the Pro version at http://www.datamystic.com/textpipeprobeta.exe