Enhancing the filename for the split filter?

Get help with installation and running here.

Moderators: DataMystic Support, Moderators

DFH
Posts: 636
Joined: Sun Dec 09, 2007 2:49 am
Location: UK

Enhancing the filename for the split filter?

Postby DFH » Wed Dec 30, 2009 2:49 am

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.

User avatar
DataMystic Support
Site Admin
Posts: 2138
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Enhancing the filename for the split filter?

Postby DataMystic Support » Fri Jan 08, 2010 9:45 am

Hi there,

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

Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments

DFH
Posts: 636
Joined: Sun Dec 09, 2007 2:49 am
Location: UK

Re: Enhancing the filename for the split filter?

Postby DFH » Sun Jan 10, 2010 2:38 am

Let's try it and see! Thanks.

David

DFH
Posts: 636
Joined: Sun Dec 09, 2007 2:49 am
Location: UK

Re: Enhancing the filename for the split filter?

Postby DFH » Wed Feb 24, 2010 5:01 am

You broke the existing code! See my new issue.

DFH
Posts: 636
Joined: Sun Dec 09, 2007 2:49 am
Location: UK

Re: Enhancing the filename for the split filter?

Postby DFH » Thu Feb 25, 2010 6:20 pm

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?

User avatar
DataMystic Support
Site Admin
Posts: 2138
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Enhancing the filename for the split filter?

Postby DataMystic Support » Mon Mar 01, 2010 5:51 am

Yes - I think an @macro would work nicely. Need to check...
Regards,

Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments

DFH
Posts: 636
Joined: Sun Dec 09, 2007 2:49 am
Location: UK

Re: Enhancing the filename for the split filter?

Postby DFH » Sat Mar 06, 2010 7:46 pm

Simon,

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

David

User avatar
DataMystic Support
Site Admin
Posts: 2138
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Enhancing the filename for the split filter?

Postby DataMystic Support » Tue Mar 09, 2010 8:58 am

Sorry, you only have the Standard version. You can review the Beta of the Pro version at http://www.datamystic.com/textpipeprobeta.exe
Regards,

Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments


Return to “TextPipe Tips and Tricks, Questions and Support”

Who is online

Users browsing this forum: No registered users and 5 guests