Scott Mintz

In a separate thread discussing formatting line numbers in FFIND's output, I tried to use @format to format the number with leading zeros.
Using the Readme.txt in the TC18 install directory I did:

Code:

[C:\TC18] do l in /p ffind /l /v /t"Take" readme.txt (echo.%@rereplace["\[(\d+)\](.+)",[%@format[05,\1]]\2,%l])
---- C:\TC18\readme.txt
[0001] Take Command x64 v18.0
[00012] Greetings, and thanks for trying Take Command!
[00015] Take Command, including:
[00028] Take Command version 18 is a major update -- we've added over 200 new
[00061] Take Command gives you a 30-day evaluation period. The number of days
[00068] When you purchase a new or upgrade copy of Take Command, you will receive
[00069] an email with your registration key. Start Take Command, click on the
[00070] "Options / Configure Take Command" menu entry, and select the "Register"
[00075] to reinstall Take Command. If you have lost your registration key, you
[00081] The following files are included with Take Command x64 18.0:
[00083] TCMD.EXE Take Command program file
[00084] TCC.EXE Take Command Console program file
[00096] IDE.EXE Take Command IDE / debugger
[000104] LICENSE.TXT Take Command user license
[000108] regid.2002-09.com.jpsoft_Take Command x64 18.0.swidtag
[000117] TAKECMD.DLL Shared DLL for Take Command and TCC
[000122] Take Command Folders and List View context menus.
[000123] TCMD.CHM Take Command / TCC online help
[000124] TCMDHERE.BTM Batch file to add "Take Command Prompt Here" to
[000165] Take Command is a registered trademark of JP Software Inc. TCC is JP
20 lines in 1 file

I expected the format to be 5 digits long in each case with leading zeroes.

g:\tc18> do l in /p ffind /k /m /l /v /t"Take" readme.txt (echo [%@format[05,%@strip[^[^],%@word[0,%l]]]]^t%@word[1-100000,%l])
[00001] Take Command v18.0
[00012] Greetings, and thanks for trying Take Command!
[00015] Take Command, including:
[00028] Take Command version 18 is a major update -- we've added over 200 new
[00061] Take Command gives you a 30-day evaluation period. The number of days
[00068] When you purchase a new or upgrade copy of Take Command, you will receive
[00069] an email with your registration key. Start Take Command, click on the
[00070] "Options / Configure Take Command" menu entry, and select the "Register"
[00075] to reinstall Take Command. If you have lost your registration key, you
[00082] The following files are included with Take Command 18.0:
[00084] TCMD.EXE Take Command program file
[00085] TCC.EXE Take Command Console program file (formerly 4NT.EXE)
[00097] IDE.EXE Take Command IDE / debugger
[00106] LICENSE.TXT Take Command user license
[00110] regid.2002-09.com.jpsoft_Take Command 18.0.swidtag
[00119] TAKECMD.DLL Shared DLL for Take Command and TCC
[00124] Take Command Folders and List View context menus
[00125] TCMD.CHM Take Command / TCC online help
[00128] TCMDHERE.BTM Batch file to add "Take Command Prompt Here" to
[00169] Take Command is a registered trademark of JP Software Inc. TCC is JP

g:\tc18> do l in /p ffind /k /m /l /v /t"Take" readme.txt (echo [%@formatn[05.0,%@strip[^[^],%@word[0,%l]]]]^t%@instr[%@len[%@word[0,%l]],,%l])
[00001] Take Command v18.0
[00012] Greetings, and thanks for trying Take Command!
[00015] Take Command, including:
[00028] Take Command version 18 is a major update -- we've added over 200 new
[00061] Take Command gives you a 30-day evaluation period. The number of days
[00068] When you purchase a new or upgrade copy of Take Command, you will receive
[00069] an email with your registration key. Start Take Command, click on the
[00070] "Options / Configure Take Command" menu entry, and select the "Register"
[00075] to reinstall Take Command. If you have lost your registration key, you
[00082] The following files are included with Take Command 18.0:
[00084] TCMD.EXE Take Command program file
[00085] TCC.EXE Take Command Console program file (formerly 4NT.EXE)
[00097] IDE.EXE Take Command IDE / debugger
[00106] LICENSE.TXT Take Command user license
[00110] regid.2002-09.com.jpsoft_Take Command 18.0.swidtag
[00119] TAKECMD.DLL Shared DLL for Take Command and TCC
[00124] Take Command Folders and List View context menus
[00125] TCMD.CHM Take Command / TCC online help
[00128] TCMDHERE.BTM Batch file to add "Take Command Prompt Here" to
[00169] Take Command is a registered trademark of JP Software Inc. TCC is JP

g:\tc18> do l in /p ffind /l /v /t"Take" readme.txt (echo.%@rereplace["\[(\d+)\](.+)",[%@formatn[05.0,\1]]\2,%l])
---- G:\TC18\readme.txt
[00000] Take Command v18.0
[00000] Greetings, and thanks for trying Take Command!
[00000] Take Command, including:
[00000] Take Command version 18 is a major update -- we've added over 200 new
[00000] Take Command gives you a 30-day evaluation period. The number of days
[00000] When you purchase a new or upgrade copy of Take Command, you will receive
[00000] an email with your registration key. Start Take Command, click on the
[00000] "Options / Configure Take Command" menu entry, and select the "Register"
[00000] to reinstall Take Command. If you have lost your registration key, you
[00000] The following files are included with Take Command 18.0:
[00000] TCMD.EXE Take Command program file
[00000] TCC.EXE Take Command Console program file (formerly 4NT.EXE)
[00000] IDE.EXE Take Command IDE / debugger
[00000] LICENSE.TXT Take Command user license
[00000] regid.2002-09.com.jpsoft_Take Command 18.0.swidtag
[00000] TAKECMD.DLL Shared DLL for Take Command and TCC
[00000] Take Command Folders and List View context menus
[00000] TCMD.CHM Take Command / TCC online help
[00000] TCMDHERE.BTM Batch file to add "Take Command Prompt Here" to
[00000] Take Command is a registered trademark of JP Software Inc. TCC is JP
20 lines in 1 file