On 29/02/2012 02:21, colin wrote:
> LMOD is a little filter writen by Horst Schaeffer.
>
> I have just discovered it. It seems many people are familer with it.
> I'm hoping some of the people here have used it.
Horst has some wonderful tools. Lmod was invaluable for Win9x systems where the for /f wasn't available with delims and tokens but much is able to be done natively in Windows NT and later these days.
I did intend using Lmod a lot more and asked Horst if I could post an ascii binary version of Lmod, which you will find below, but then I got into XP and started using the native commands.
The URL listed has changed - but this ascii version can be included in batch files and that was the reason I wanted to include it.
Below the ascii binary you will find some of the ways I used it and should all work with Win98SE.
@echo off
:: Ascii version of Horst Schaeffer's - LMOD 1.3/ASCII
:: Documentation and info:
http://home.mnet-online.de/horst.muc/
:: Converted with tools from Herbert Kleebauer
echo Bj@jzh`0X-`/PPPPPPa(DE(DM(DO(Dh(Ls(Lu(LX(LeZRR]EEEUYRX2Dx=>
lmod.com
echo 0DxFP,0Xx.t0P,=XtGsB4o@$?PIyU WwX0GwUY Wv;ovBX2Gv0ExGIuht6>>
lmod.com
echo EvhBYXMiON?iCdQiF@SiPAEi?OcAumHThk`TN_cPhsoTLmnD?MI?mxRTw`>>
lmod.com
echo sTqd_SqnqTuILoAiE@ustp@iE@{Ms@Jv~Dq`{Sy{EOcAv@RB11??zABFyg>>
lmod.com
echo Et@CzFIYLj@KB~?is?@OBBEcqGzRBZfvv~{S@{JO{Eq@AvYDB_Ko?zRHFy>>
lmod.com
echo ?_t@zPFIEgj@Bq~?Lg?@z@BEsPGzBMZfq\}UBf?FP`q@{OCwF?EBsP]sj1>>
lmod.com
echo ?IBBQ??O?jepHjep?KIazohBAfM?eLrPfevBBeAC}E@vgtNveBY\eQj[fu>>
lmod.com
echo vB~?AwFu@CQN}1~lg~I?YxAIowiBiMYLcNsRHmUL@KiKs@ULcNsB{OZ{jB>>
lmod.com
echo ifsLYLcNDRjkcsQvB?j{?AzAJUHmAAKSL?suJB`kJSU`zUM`i???As?ZJ`>>
lmod.com
echo Lbxc}`}GO_HFq`?zqJ~s?Gr`LR?jAoEWJ}DY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jWooCu`ir_k{~jBStaC{C>>
lmod.com
echo IAKs\DsL{O{EGCBsaCmji}{fjBLt}DgBvq?{nmrB~RjiBwb{U?eKtPOEJE>>
lmod.com
echo h}IE{ygzMEjR}rgvkOq`s_{O{MzFCt\DehE\Ej~NiZoe]uJEkEEF{k@G@t>>
lmod.com
echo LChiBzk~Ols_{O{MzF@snCkEBfzjg~FP~EsR{SA{FOEWtpFLDO_{kAiIs`>>
lmod.com
echo p~@]sqFs?zhFi?oa{LjNvtKDgHvqe{p[t?D]e?@SGEHEl{?A?Ds`ty{OvE>>
lmod.com
echo QcVgHKze{FuGEPHeEcjKEp{?EGDtiCM?EXj@joM{QQvRt`ugH{HezfoOE`>>
lmod.com
echo wgHohEGE~zhvtD{SM?FWhAjo{~oLTtVDgBvqCzSnAt?Fs?}ncuQ{cEHE~V>>
lmod.com
echo hvkEEFJyAgZg@KNh{n@}?g{k?Gzs_sL{M@@Es`~n{?yKt`zFq`g?@ohz~~>>
lmod.com
echo g?opH~gky[u`j1AA@zHJ?s?Wg`Lruzq~CjE@eTtTCE~FEJeXzeCCqGEPZD>>
lmod.com
echo hzuEtpAjE@gfsp{}{KIslCWUJE{Fg~ILwAAyjiNJ1wzPhks?@_`L?LjM?E>>
lmod.com
echo ~eGsuOEpGjE@uqsx@jE@eIsPCEJEEzePaqKck}?EEt@C@\yIz=gv??zAL}>>
lmod.com
echo sq@z`G}s?Gs`LbEIKX`LkK?Fq@????@???????~~~~?@~B?????????1AA>>
lmod.com
echo ??????????????A?B@??????zk_???=???????????????????????????>>
lmod.com
echo ??????????K?}OCNLTmp_?@nrOHBRTl_H@mh_SyneDsg_SyosDgnnOdlnT>>
lmod.com
echo mlmSlsdDkmnTdmhTdcmSngnSsrqTtlmSLnb@A{IgxzvWIsBWw`LbrK~V`L>>
lmod.com
echo AKFc=A}jhz0x>>
lmod.com
::
::LMOD 1.3 Filter (c) 2002 Horst Schaeffer
::Syntax: LMOD options string_with_tokens
::Options:
:: /Ln[-m] line [range] to select (default: first non blank line)
:: /L[n]* all lines [starting n]
:: /E include empty input lines (default: no output)
:: /S.. delimiters for word extraction, instead of default (,;=)
:: /B.. as /S, but excluding blank space as delimiter
:: /Nn starting line number (for token [#]), default: /N001
::Insert from source line (expression in square brackets):
:: [p,l $n U|L Rn] default []: complete line
:: p,l from position p, length l (default rest of line)
:: $n word number n ("!" for last word); optionally ąoffset
:: $n:m range of words by number (blank space will be inserted)
:: U|L convert to upper|lower case
:: Rn right aligned in output field of size n
::Other tokens:
:: [+] insert CR+LF
:: [-] omit CR+LF at end of output
:: [#] line number (digits acc. to option, default:3)
:: [=n] tab to position n in output line
:: [~n] ASCII code n (decimal)
:: [".."] quoted char/string (use for redirection symbols)
::======================================================================
:: Renames *.* to *-date-time.* and uses LMOD and LOGECHO from
::
http://home.nikocity.de/horst.muc/int/index.htm
:: and Microsoft's FIND - Tested with Windows 98 SE
:: execute and examine temp2.bat first to check the output.
:: then remove the :: from the two lines below and rerun it
@echo off
logecho set d8t=$D$M$Y-$h$m$s>temp.bat
call temp.bat
del temp.bat
dir *.* /b /o:n /-p /a:-d>temp.000
type temp.000|find /v /i "temp.000">temp.001
type temp.001|lmod /L1* /B. @ren "[$1].[$2]" "[$1]-%d8t%.[$2]">temp2.bat
:: call temp2.bat
:: del temp2.bat
del temp.000
del temp.001
set d8t=
::======================================================================
@echo off
:: creates brief MP3 list in each directory on C: with directoryname.txt as list filename
dir c:\ /a:d /o:n /s /b /-p >c:\dirlist.txt
type c:\dirlist.txt|lmod /l* /b\ dir [1]\*.mp3 /b /on[~62]"[1]\[$!].txt">c:\mp3list2.bat
del c:\dirlist.txt
:: call c:\mp3list2.bat
::======================================================================
echo.|date|lmod /s/ set date=[29,2][$6][$5]>temp.bat
::======================================================================
dir o:\|find " dir(s) "|lmod /l* Drive O: has [19]
::======================================================================
cd|lmod /S\ set d=[$!]>%temp%.\temp001.bat
--
Mic