Getting specific line in a file

Acer Aspire 5920g
July 25, 2010 at 08:46:48
Specs: Microsoft Windows 7 Professional, 2.201 GHz / 2046 MB
Hi all, basically i want to retrieve the information for
BUILTIN\Administrators and NT AUTHORITY\SYSTEM only and filter away the rest. I am wondering how to do it.. The command for it would be cacls C:\windows\System32\at.exe


Text Output below
C:\windows\System32\at.exe SEAN\IUSR_SEAN:(DENY)(special access:)
DELETE
READ_CONTROL
WRITE_DAC
WRITE_OWNER
STANDARD_RIGHTS_REQUIRED
FILE_READ_DATA
FILE_WRITE_DATA
FILE_APPEND_DATA
FILE_READ_EA
FILE_WRITE_EA
FILE_EXECUTE
FILE_DELETE_CHILD
FILE_READ_ATTRIBUTES
FILE_WRITE_ATTRIBUTES

BUILTIN\Administrators:(special access:)
READ_CONTROL
SYNCHRONIZE
FILE_GENERIC_READ
FILE_GENERIC_WRITE
FILE_GENERIC_EXECUTE
FILE_READ_DATA
FILE_WRITE_DATA
FILE_APPEND_DATA
FILE_READ_EA
FILE_WRITE_EA
FILE_EXECUTE
FILE_READ_ATTRIBUTES
FILE_WRITE_ATTRIBUTES

BUILTIN\Power Users:R
NT AUTHORITY\SYSTEM:F


See More: Getting specific line in a file

Report •

#1
July 25, 2010 at 17:39:14
download gawk for windows(see my sig), then use this one liner

C:\test>gawk -vRS= "NR==2 || NR==3{print}" file
BUILTIN\Administrators:(special access:)
READ_CONTROL
SYNCHRONIZE
FILE_GENERIC_READ
FILE_GENERIC_WRITE
FILE_GENERIC_EXECUTE
FILE_READ_DATA
FILE_WRITE_DATA
FILE_APPEND_DATA
FILE_READ_EA
FILE_WRITE_EA
FILE_EXECUTE
FILE_READ_ATTRIBUTES
FILE_WRITE_ATTRIBUTES
BUILTIN\Power Users:R
NT AUTHORITY\SYSTEM:F

GNU win32 packages | Gawk


Report •
Related Solutions


Ask Question