If you trust the VB script "sed-like" of this answer...
sed.vbs:
Dim pat, patparts, rxp, inp
pat = WScript.Arguments(0)
patparts = Split(pat,"/")
Set rxp = new RegExp
rxp.Global = True
rxp.Multiline = False
rxp.Pattern = patparts(1)
Do While Not WScript.StdIn.AtEndOfStream
inp = WScript.StdIn.ReadLine()
WScript.Echo rxp.Replace(inp, patparts(2))
Loop
You can type
cscript /Nologo sed.vbs s/^\d+\s*$/ < in.txt
(in.txt being your initial text)
and you will obtain the expected output...
^\d+\s*$
Would target any line beginning with one or more digit, followed by 0 or more spaces within one line.
That is not the best "pure sed" solution and it can not actually delete lines, but this is a native "vista-compliant" solution...
Actually, the following hack deliberately interpreting the "d
sed-command" could be able to 'delete' lines:
Dim pat, patparts, rxp, inp
pat = WScript.Arguments(0)
patparts = Split(pat,"/")
Set rxp = new RegExp
rxp.Global = True
rxp.Multiline = False
rxp.Pattern = patparts(1)
Do While Not WScript.StdIn.AtEndOfStream
inp = WScript.StdIn.ReadLine()
out = rxp.Replace(inp, patparts(2))
if not patparts(2)="d" or not out="d" Then
WScript.Echo out
end if
Loop
cscript /Nologo sed.vbs s/^\d+\s*$/ < in.txt
would actually produce:
[aaa bbb]
[ccc ddd]
In a .bat, you could have a sed.bat:
cscript /Nologo sed.vbs %1 < %2
and then execute that .bat like this:
C:\prog\sed>sed.bat s/^\d+\s*$/d in.txt