Insert Parent directory name

Get help with installation and running here.

Moderators: DataMystic Support, Moderators

rhmelis
Posts: 5
Joined: Fri Dec 04, 2009 8:01 am

Insert Parent directory name

Postby rhmelis » Fri Dec 04, 2009 8:16 am

Hello! Textpipe is great, but the number of features is a bit intimidating :D Anyway, I am looking for a way to insert (i.e. replace a string) with the name of the directory the file resides in.

For example this file: C:\Stuff\documents\file.txt contains the searchstring [DIR]. Can Textpipe replace that string with documents or even Stuff\documents or C:\Stuff\documents\?

I've searched the forums and found hints pointing to @FullInputFilename but that string in itself does not work (i'm probably using it wrong). And I can't find anything about strings like that in the online documentation...

Thanks for your time!

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

Re: Insert Parent directory name

Postby DataMystic Support » Tue Dec 08, 2009 9:48 am

Just use a search and replace to find:

Code: Select all

[DIR]

and replace with

Code: Select all

**@FullInputFilename**


Then you use use a second search replace to trim the trailing filename from @FullInputFilename by using the ** as markers.
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: Bing [Bot] and 2 guests