android - How to use findstr to get MAC address? -


i send adb shell dumpsys wifi current available wifi ap bssid(mac address).the result follows: latest scan results:

    bssid              frequency  rssi    age      ssid                                 flags    7c:7d:3d:c3:4c:e0       2422    -40    6.716    huawei-yjdad5                     [wpa2-psk-ccmp][ess]    d4:ee:07:26:24:18       2432    -50    6.716    hiwifi_refine                     [wpa-psk-ccmp][wpa2-psk-ccmp][ess]    24:09:95:55:54:20       2442    -52    6.716    huawei-5420                       [wpa2-psk-ccmp][wps][ess]    70:72:3c:97:52:b8       2437    -53    6.716    huawei-h6fcxt                     [wpa-psk-ccmp+tkip][wpa2-psk-ccmp+tkip][wps][ess]    0c:d6:bd:3d:f6:14       2417    -52    6.716    huawei-dus8fg                     [wpa-psk-ccmp+tkip][wpa2-psk-ccmp+tkip][wps][ess]    f0:b4:29:20:21:1b       2442    -54    6.716    xiaomi_211a11                     [wpa-psk-ccmp+tkip][wpa2-psk-ccmp+tkip][wps][ess]    80:38:bc:05:ed:a1       2412    -58    6.716    huawei-employee                   [wpa2-eap-ccmp][ess]    e0:19:1d:cc:7c:a4       2412    -57    6.715    huawei-b83gl6                     [wpa-psk-ccmp][wpa2-psk-ccmp][wps][ess]    18:c5:8a:17:4b:a1       2412    -60    6.715    huawei-employee                   [wpa2-eap-ccmp][ess] 

so how use findstr regular expression on windows collect bssid result? tried adb shell dumpsys wifi | findstr /r "[0-9a-f]{2}(:[0-9a-f]{2}){5}" nothing

regular expression support findstr limited , not support features of regular expression implementation in perl interpreter, or regular expression class in boost library, or javascript regexp object supports. support regular expressions in perl syntax, implementations , features different. run in command prompt window findstr /? displayed of console application , regular expressions supported findstr.

but findstr designed output line containing found string , not found string. not make sense non regular expression search in file output found string equal search string, perhaps exception of case in case of using option /i , search string containing letters.

therefore suggest use command for mac address written text file.

@echo off rem delete perhaps existing output file.  if exist macaddress.txt del macaddress.txt  rem run command wifi data, skip first line of output, , rem write output file first data column mac addresses.  /f "skip=1" %%i in ('adb.exe shell dumpsys wifi') echo %%i>>macaddress.txt 

for understanding used commands , how work, open command prompt window, execute there following commands, , read entirely pages displayed each command carefully.

  • del /?
  • echo /?
  • for /?
  • if /?

see microsoft article using command redirection operators explanation of >>.


Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -