たとえば、処理する必要があるテキスト ファイルのコレクションがあるとします (たとえば、特定のラベルを検索して値を抽出するなど)。問題に取り組むための一般的な方法は何ですか?
私もこれを読みました:「Pythonから変数値を取得する」しかし、私が直面しているいくつかのケースには当てはまらないようです( のtab
代わりに like が使用されています:
)
使用する言語に関係なく、問題に取り組むための最も適切な方法を知りたいだけです。
次のようなものがあるとします。
Name: Backup Operators SID: S-1-5-32-551 Caption: COMMSVR21\Backup Operators Description: Backup Operators can override security restrictions for the sole purpose of backing up or restoring files Domain: COMMSVR21
COMMERCE/cabackup
COMMSVR21/sys5erv1c3
Backup Operators
の値にアクセス/取得し、その代わりにCOMMERCE/cabackup
&を取得できるようにしたいと考えていますCOMMSVR21/sys5erv1c3
。
どのようにしますか?
私が考えたのは、テキスト ファイル全体、正規表現検索、およびおそらくいくつかの if else ステートメントを読み取ることです。これは効果的ですか?それとも、テキスト ファイルをおそらく何らかの配列に解析して取得するのでしょうか。わからない。
別の例のように、次のように言います。
GPO: xxx & yyy Servers
Policy: MaximumPasswordAge
Computer Setting: 45
テキスト ファイルをチェックしPolicy = MaximumPasswordAge
て値を返すにはどうすればよいでしょう45
か。
ありがとう!
p/s -- 私はこれを Python (知識がないため、その場で取り上げる) または Java で行っている可能性があります。
pp/s -- スポイラー タグがないことに気付きました。うーん
--
ログの例: ディレクトリ権限のあるログ:
C:\:
BUILTIN\Administrators Allowed: Full Control
NT AUTHORITY\SYSTEM Allowed: Full Control
BUILTIN\Users Allowed: Read & Execute
BUILTIN\Users Allowed: Special Permissions:
Create Folders
BUILTIN\Users Allowed: Special Permissions:
Create Files
\Everyone Allowed: Read & Execute
(No auditing)
C:\WINDOWS:
BUILTIN\Users Allowed: Read & Execute
BUILTIN\Power Users Allowed: Modify
BUILTIN\Power Users Allowed: Special Permissions:
Delete
BUILTIN\Administrators Allowed: Full Control
NT AUTHORITY\SYSTEM Allowed: Full Control
(No auditing)
次の別のもの:
Audit Policy
------------
GPO: xxx & yyy Servers
Policy: AuditPolicyChange
Computer Setting: Success
GPO: xxx & yyy Servers
Policy: AuditPrivilegeUse
Computer Setting: Failure
GPO: xxx & yyy Servers
Policy: AuditDSAccess
Computer Setting: No Auditing
これはタブ区切りのものです:
User Name Full Name Description Account Type SID Domain PasswordIsChangeable PasswordExpires PasswordRequired AccountDisabled AccountLocked Last Login
53cuR1ty Built-in account for administering the computer/domain 512 S-1-5-21-2431866339-2595301809-2847141052-500 COMMSVR21 True False True False False 09/11/2010 7:14:27 PM
ASPNET ASP.NET Machine Account Account used for running the ASP.NET worker process (aspnet_wp.exe) 512