Enhancing the filename for the split filter?

Get help with installation and running here.

Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators

Post Reply
dfhtextpipe
Posts: 986
Joined: Sun Dec 09, 2007 2:49 am
Location: UK

Enhancing the filename for the split filter?

Post 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.
David
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Enhancing the filename for the split filter?

Post 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?
dfhtextpipe
Posts: 986
Joined: Sun Dec 09, 2007 2:49 am
Location: UK

Re: Enhancing the filename for the split filter?

Post by dfhtextpipe »

Let's try it and see! Thanks.

David
David
dfhtextpipe
Posts: 986
Joined: Sun Dec 09, 2007 2:49 am
Location: UK

Re: Enhancing the filename for the split filter?

Post by dfhtextpipe »

You broke the existing code! See my new issue.
David
dfhtextpipe
Posts: 986
Joined: Sun Dec 09, 2007 2:49 am
Location: UK

Re: Enhancing the filename for the split filter?

Post 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?
David
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Enhancing the filename for the split filter?

Post by DataMystic Support »

Yes - I think an @macro would work nicely. Need to check...
dfhtextpipe
Posts: 986
Joined: Sun Dec 09, 2007 2:49 am
Location: UK

Re: Enhancing the filename for the split filter?

Post 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
David
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Enhancing the filename for the split filter?

Post 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
Post Reply