解析`nbtstat -a`的输出 [英] Parsing output of `nbtstat -a`

查看:66
本文介绍了解析`nbtstat -a`的输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到了一个文本文件,其中包含我们网络中各种计算机的''nbtstat -a''输出。脚本需要提取计算机的名称,并且是否有nbtstat读取的用户名;提取它。如果没有用户名,则脚本需要说'没有找到用户'。有没有人知道我会怎么做?

I have been given a text file that contains ''nbtstat -a'' output for various computers in our network. The script needs extract the name of the computer and if there is a user name that nbtstat reads; extract that as well. If there is no user name then the script needs to say something like ''no user found''. does anyone have an idea how i would do that?

推荐答案

首先,我从来没有听说过nbstat,并且不会有最模糊的线索,关于什么格式的输出是。您能否提供一份数据样本,以便我们看到它?


此外,我们很乐意为您提供帮助,但必须先看看您迄今为止所尝试的内容。请发布您尝试的代码,我们将从那里为您提供帮助。


问候,


Jeff
First, I have never heard of nbstat and would not have the foggiest clue as to what the format of the output is. Could you possibly provide a sample of the data so we can see it?

Also, we will be happy to help you, but must first see what you have tried thus far. Please post the code that you have tried and we will assist you from there.

Regards,

Jeff

以下是输出示例

Here is a sample of the output

展开 | 选择 | Wrap | 行号


好吧,我们当然可以帮到你,这就是我们在这里的目的。感谢您提供输出,因为这有助于我理解数据的结构。我完全理解改变数据,工作是有效的,总会有我们必须保护的信息。


至于你的脚本,我可以从你的代码中假设你只想输出列出名称/类型/状态的行。那么,以下内容如下:

Well, we can certainly help you, that is what we are here for. Thank you for providing the output as that helped me to understand the data''s structure. I fully understand changing the data, work is work and there will always be information we have to safeguard.

As for your script, I can assume from your code you are only wanting to output the lines that list the Name/Type/Status. So, what about the following:

展开 | 选择 | Wrap | 行号


这篇关于解析`nbtstat -a`的输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆