Sign in to follow this  
Followers 0
guner7

SRE help required please

27 posts in this topic

Hello,

I am not new to autoit , but I am still new to its coding...sounds contradict...in short, Au3 noob is what I am. ;)

First of all, I am not asking for a script but rather just want to know whether my idea is feasible to complete with using autoit programming.

Please look at the 'sample log' I've attached where you can find much of junk inside to read.

Of my GUI there would be an input and edit control of course with some button as well.

Now I will copy everything in the sample log and paste into edit control, then say, I want to filter all set of info belongs to MYJ220062T. Here I will consider a set of info that belongs to its serial number as below:

@SERNUM=MYJ220066A
@CUSTOMER=HP
@BOARD=SD2_AH341-60401
@TESTER=gr247
@PROCESS=ICT
@FIXTURE_SLOT=1
@SOFTWARE_DOC=GENDSK-001
@SOFTWARE_REV=A
@ASSEMBLY_NUM=AH341-60401
@ASSEMBLY_REV=B-5134
@OPERATOR=GIRIS1
@LINE=01
@SITE=6
@START=18-MAY-12  19:42:00
>
~
PASSED CONTACT TEST!
~
~
R228(R228)
EXPECTED        ACTUAL
4.64K OHMS     1.21MEG OHMS
LIMITS ARE 4.31K AND  989K OHMS
~
~
I2C EEPROM U31 FAILED TO VERIFY!
~
~
U31_FRU FAILED PROGRAM VERIFICATION!
18-MAY-12  19:42:44
BOARD SOLOXBAR_60301_NAV FAILED
~
>
@FAIL
@END=18-MAY-12  19:42:44
>
=============

With everything pasted into edit control and MYJ220062T (wanted sn) entered into input control, then press a button. Now all text in edit control will be override with the fetched result as below:

@SERNUM=MYJ220062T
@CUSTOMER=HP
@BOARD=SD2_AH341-60401
@TESTER=gr247
@PROCESS=ICT
@FIXTURE_SLOT=1
@SOFTWARE_DOC=GENDSK-001
@SOFTWARE_REV=A
@ASSEMBLY_NUM=AH341-60401
@ASSEMBLY_REV=B-5134
@OPERATOR=BAHADUR
@LINE=01
@SITE=6
@START=18-MAY-12  18:20:59
>
~
CONTACT1
(3844)
~
~
3844  ICT_PHY_TCK          04-B112  VIA4769                BOTTOM
NO CONTACT TO SENSE NODES
PASSED CONTACT TEST! after 2 cycles
~
~
R835(R87)
EXPECTED        ACTUAL
42.2 OHMS      48.18 OHMS
LIMITS ARE  40 AND  48 OHMS
~
~
R228(R228)
EXPECTED        ACTUAL
4.64K OHMS     622.46K OHMS
LIMITS ARE 4.31K AND 4.92K OHMS
~
~
U31 PASSED!  U31 PROGRAMMING IS GOOD
~
~
U31_FRU PASSED PROGRAM VERIFICATION!
18-MAY-12  18:21:46
BOARD SOLOXBAR_60301_NAV FAILED
~
>
@FAIL
@END=18-MAY-12  18:21:46
>
=============

@SERNUM=MYJ220062T
@CUSTOMER=HP
@BOARD=SD2_AH341-60401
@TESTER=gr247
@PROCESS=ICT
@FIXTURE_SLOT=1
@SOFTWARE_DOC=GENDSK-001
@SOFTWARE_REV=A
@ASSEMBLY_NUM=AH341-60401
@ASSEMBLY_REV=B-5134
@OPERATOR=BAHADUR
@LINE=01
@SITE=6
@START=18-MAY-12  18:26:49
>
~
PASSED CONTACT TEST!
~
~
U31 PASSED!  U31 PROGRAMMING IS GOOD
~
~
U31_FRU PASSED PROGRAM VERIFICATION!
~
>
@PASS
@END=18-MAY-12  18:27:31
>
=============

All two set info belongs to MYJ220062T were found.

So, can it be coded in autoit to get the things right?

Thank you for your input.

Share this post


Link to post
Share on other sites



Sorry I forget the attachment.

Ps. I can't find any Edit button to edit my previous post. ;)

sample log.txt

Share this post


Link to post
Share on other sites

Should be possible.

But before you start to code I would think about where to store the data. Could be Ini-Files, a SQLite database or just flat files like your log file.

This decision will have an heavy impact on how easy you can code the rest of your script.

The decision needs to take into account the number of records, the processing speed needed, the format of the data (fixed or free format) etc.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

guner7,

Welcome to the AutoIt forum. ;)

You need at least 5 posts to get access to some of the forum features - like the post "Edit" button. :)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Here is something for you for TXT parsing to start with (not exactly good because I'm not RegExp expert)

#include <String.au3>

$xml = '=============' & FileRead(@ScriptDir & 'sample log.txt') & '============='
;~ ConsoleWrite($xml & @CRLF)

$records = StringRegExp($xml, '(?i)(?s)=============(.*?)=============', 3)
ConsoleWrite('Number of records: ' & UBound($records) & @CRLF)

For $i = 0 To UBound($records) - 1
    $record = $records[$i]
;~     ConsoleWrite('record: ' & $record & @CRLF)
    $sn = GetValue($record, '@SERNUM')
    ConsoleWrite('ser num: ' & $sn & @CRLF)
Next

Func GetValue($xml_data, $name_col)
    Return StringBetween($xml_data, $name_col & '=', 'rn')
EndFunc

Func StringBetween($sString, $sStart, $sEnd)
    $sReturn = _StringBetween($sString, $sStart, $sEnd, -1, 1)
;~     $sReturn = StringRegExp($sString, '(?i)' & $sStart & '(.*?)' & $sEnd, 3)
    If @error Then Return ''
    Return StringStripWS($sReturn[0],3)
EndFunc

Here is similar post with XML/TXT parsing

GUI part is very simple, you can use Koda to create GUI

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

I am appreciate with all the input, the responds is quick enough to shocked me. ;)

But it sounds a bit heavy of the coding that might turn out to be, Water.

That's very kind of you, Zedna. It would be a great kick start with the codes.

And thanks for the info M23, I will spam later to get the edit button!! Posted Imagejust kidding...

I will update when I get the whole things done.

Edited by guner7

Share this post


Link to post
Share on other sites

Hi Zedna, your given expression works great to parsing the portion of the wanted SN.

But how about a level further which is to parse only the character like R835, R87, U31 within the desired portion with just one expression?

I can only parse the character with the parsed portion with this, b([CDEFJLPQRU]{1}d{1,6})b but couldn't figure out how to incorporate it with your expression.

Hope I am not confuse my question.

Share this post


Link to post
Share on other sites

Just ignore the above question.

I am really couldn't figure out of an expression for parse the following results:

say,

~
~
R1205(B1_R8)
EXPECTED     ACTUAL
100 OHMS     219.26K OHMS
LIMITS ARE 80 AND 120 OHMS
0699-7203 X/Y= -0.68 11.785 TOP
~
~
CHAN A/E: XN674Y11174[6472]
CHAN B/F: X9276Y50[469]
CHAN C/G/GND: V12_RAW_MID[6320]
~
~
R1696(R892)
EXPECTED     ACTUAL
130 OHMS     63.71MEG OHMS
LIMITS ARE 117 AND 143 OHMS
0699-8651 X/Y= 19.013 15.174 BOTTOM
~
~

How can I write an expression to parse an entire line (eg, R1205(B1_R8) or R1696(R892)) after "~" to achieve the result as following,

R1205(B1_R8)
R1696(R892)

I think of the patterns I need here are:

  • the new line after "~" (only ONE line which is before "EXPECTED" in the following line)
  • exclude the new line that starting with "CHAN" after "~" (besides CHAN, it could be other word as well such as CONTACT1)
I'm looking forward and greatly appreciated with any help on this.

Share this post


Link to post
Share on other sites

guner7,

I would do it like this: :)

#include <Array.au3> ; Just for the display

$sText = "~" & @CRLF & _
        "~" & @CRLF & _
        "R1205(B1_R8)" & @CRLF & _
        "EXPECTED     ACTUAL" & @CRLF & _
        "100 OHMS     219.26K OHMS" & @CRLF & _
        "LIMITS ARE 80 AND 120 OHMS" & @CRLF & _
        "0699-7203 X/Y= -0.68 11.785 TOP" & @CRLF & _
        "~" & @CRLF & _
        "~" & @CRLF & _
        "CHAN A/E: XN674Y11174[6472]" & @CRLF & _
        "CHAN B/F: X9276Y50[469]" & @CRLF & _
        "CHAN C/G/GND: V12_RAW_MID[6320]" & @CRLF & _
        "" & @CRLF & _
        "~" & @CRLF & _
        "R1696(R892)" & @CRLF & _
        "EXPECTED     ACTUAL" & @CRLF & _
        "130 OHMS     63.71MEG OHMS" & @CRLF & _
        "LIMITS ARE 117 AND 143 OHMS" & @CRLF & _
        "0699-8651 X/Y= 19.013 15.174 BOTTOM" & @CRLF & _
        "~" & @CRLF & _
        "~"

; Extract lines starting with "R" followed by 4 digits
$aRet = StringRegExp($sText, "v(Rd{4}.*)v", 3)

; This is what we get
_ArrayDisplay($aRet)

; Which we reconvert into a string like this
$sNewText = ""
For $i = 0 To UBound($aRet) - 1
    $sNewText &= $aRet[$i]
Next

MsgBox(0, "Result", $sNewText)

Please ask if you have any questions. ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Hi M23, thank you for look into it.

Your codes works great for the log above, however, as I collecting more logs after I posted the question, I realize what I've uncovered from that log was just a tip of an iceberg. Here is the may-encounter log that should looks like:

~
~
C374(C84)
EXPECTED     ACTUAL
2K OHMS  183.95MEG OHMS
LIMITS ARE 1.85K AND 2.1K OHMS
0699-8129 X/Y= -1.26 13.82 TOP
~
~
CHAN A/E: XN1107Y13783[7096]
CHAN B/F: XN1213Y13866[7135]
CHAN C/G/GND: XN1107Y13883[6983]
~
~
R165 FAILED CONTINUITY
EXPECTED     ACTUAL
2.15K OHMS   694.92MEG OHMS
LIMITS ARE 2K AND 2.42K OHMS
0699-7498 X/Y= 6.365 2.365 BOTTOM
~
~
Program rev date
~
~
U1(U1_CHECK_IDS)
EXPECTED     ACTUAL
2K OHMS  183.95MEG OHMS
LIMITS ARE 1.85K AND 2.1K OHMS
0699-8129 X/Y= -1.26 13.82 TOP
~
~
CONTACT1
CHAN B/F: XN1213Y13866[7135]
CHAN C/G/GND: XN1107Y13883[6983]
~
~
CONTACT2
CHAN B/F: XN1213Y13866[7135]
CHAN C/G/GND: XN1107Y13883[6983]
~
~
CONTACT3
CHAN B/F: XN1213Y13866[7135]
CHAN C/G/GND: XN1107Y13883[6983]
~
~
CONTACT4
CHAN B/F: XN1213Y13866[7135]
CHAN C/G/GND: XN1107Y13883[6983]
~
~
E11 FAILED CONTINUITY
EXPECTED     ACTUAL
2.15K OHMS   694.92MEG OHMS
LIMITS ARE 2K AND 2.42K OHMS
0699-7498 X/Y= 6.365 2.365 BOTTOM
~
~
U19 FAILED VENDOR TEST!
EXPECTED     ACTUAL
2K OHMS  183.95MEG OHMS
LIMITS ARE 1.85K AND 2.1K OHMS
0699-8129 X/Y= -1.26 13.82 TOP
~
~
SHORT1
CHAN A/E: XN1107Y13783[7096]
CHAN B/F: XN1213Y13866[7135]
CHAN C/G/GND: XN1107Y13883[6983]
~
~
C_3V3(C_3V3)
EXPECTED     ACTUAL
2.15K OHMS   694.92MEG OHMS
LIMITS ARE 2K AND 2.42K OHMS
0699-7498 X/Y= 6.365 2.365 BOTTOM
~
~
2443 SPD_SLM1_MBA_J15_SA1 23-A052 J15.237                BOTTOM
2442 SPD_SLM1_MBA_J15_SA2 23-A052 J15.237                BOTTOM
2444 SPD_SLM1_MBA_J15_SA3 23-A052 J15.237                BOTTOM
2445 SPD_SLM1_MBA_J15_SA4 23-A052 J15.237                BOTTOM
~
~
L4 FAILED CONTINUITY
EXPECTED     ACTUAL
2K OHMS  183.95MEG OHMS
LIMITS ARE 1.85K AND 2.1K OHMS
0699-8129 X/Y= -1.26 13.82 TOP
~
~
6761 GXE_TLDAT9      26-B158 VIA24855                BOTTOM
6762 GXE_TLDAT7      26-B158 VIA24855                BOTTOM
~
~
F8(F8_CONT)
EXPECTED     ACTUAL
2.15K OHMS   694.92MEG OHMS
LIMITS ARE 2K AND 2.42K OHMS
0699-7498 X/Y= 6.365 2.365 BOTTOM
~
~
CHAN A/E: V1P1_MEM1[7417]
CHAN B/F: X6414Y2348[840]
CHAN C/G/GND:
~
~
R265(R265_CONT)
EXPECTED     ACTUAL
2K OHMS  183.95MEG OHMS
LIMITS ARE 1.85K AND 2.1K OHMS
0699-8129 X/Y= -1.26 13.82 TOP
~
~
U56_SW1_9_10_CLOSED
EXPECTED     ACTUAL
2.15K OHMS   694.92MEG OHMS
LIMITS ARE 2K AND 2.42K OHMS
0699-7498 X/Y= 6.365 2.365 BOTTOM
~
~
U14_SEG1 FAILED CONTINUITY
EXPECTED     ACTUAL
2K OHMS  183.95MEG OHMS
LIMITS ARE 1.85K AND 2.1K OHMS
0699-8129 X/Y= -1.26 13.82 TOP
~
~
RP14_R4(RP14_R4)
EXPECTED     ACTUAL
2.15K OHMS   694.92MEG OHMS
LIMITS ARE 2K AND 2.42K OHMS
0699-7498 X/Y= 6.365 2.365 BOTTOM
~
~
V12P0 CAPS(V12P0_CAPS)
EXPECTED     ACTUAL
2K OHMS  183.95MEG OHMS
LIMITS ARE 1.85K AND 2.1K OHMS
0699-8129 X/Y= -1.26 13.82 TOP
~
~
Q11(Q11)
EXPECTED     ACTUAL
2.15K OHMS   694.92MEG OHMS
LIMITS ARE 2K AND 2.42K OHMS
0699-7498 X/Y= 6.365 2.365 BOTTOM
~
~
R1085(R1085_2)
EXPECTED     ACTUAL
2K OHMS  183.95MEG OHMS
LIMITS ARE 1.85K AND 2.1K OHMS
0699-8129 X/Y= -1.26 13.82 TOP
CHAN A/E: V3P3_STBY[7040]
CHAN B/F: X6414Y2348[840]
CHAN C/G/GND:
~
~
D1
EXPECTED     ACTUAL
2.15K OHMS   694.92MEG OHMS
LIMITS ARE 2K AND 2.42K OHMS
0699-7498 X/Y= 6.365 2.365 BOTTOM
~
~
D18_CR1_CR2
EXPECTED     ACTUAL
2K OHMS  183.95MEG OHMS
LIMITS ARE 1.85K AND 2.1K OHMS
0699-8129 X/Y= -1.26 13.82 TOP
~
~
U84
EXPECTED     ACTUAL
2.15K OHMS   694.92MEG OHMS
LIMITS ARE 2K AND 2.42K OHMS
0699-7498 X/Y= 6.365 2.365 BOTTOM
~
~
U94 (TMP275) :MFAILED:N.
~
~
CHECK U6 & U12 (R798)
~
~
R571(R571A2)
EXPECTED     ACTUAL
2K OHMS  183.95MEG OHMS
LIMITS ARE 1.85K AND 2.1K OHMS
0699-8129 X/Y= -1.26 13.82 TOP
~
~
S1(SW1_CONT)
EXPECTED     ACTUAL
2.15K OHMS   694.92MEG OHMS
LIMITS ARE 2K AND 2.42K OHMS
0699-7498 X/Y= 6.365 2.365 BOTTOM
~
~
Q7_NPN1
EXPECTED     ACTUAL
2K OHMS  183.95MEG OHMS
LIMITS ARE 1.85K AND 2.1K OHMS
0699-8129 X/Y= -1.26 13.82 TOP
~
~
P_R30(P_R30_CONT)
EXPECTED     ACTUAL
2.15K OHMS   694.92MEG OHMS
LIMITS ARE 2K AND 2.42K OHMS
0699-7498 X/Y= 6.365 2.365 BOTTOM
~
~
R19(R19_CONT)
EXPECTED     ACTUAL
2K OHMS  183.95MEG OHMS
LIMITS ARE 1.85K AND 2.1K OHMS
0699-8129 X/Y= -1.26 13.82 TOP
~
~
B2_R174(B2_R10)
EXPECTED     ACTUAL
2.15K OHMS   694.92MEG OHMS
LIMITS ARE 2K AND 2.42K OHMS
0699-7498 X/Y= 6.365 2.365 BOTTOM
~
~
P_R19(P_R19)
EXPECTED     ACTUAL
2K OHMS  183.95MEG OHMS
LIMITS ARE 1.85K AND 2.1K OHMS
0699-8129 X/Y= -1.26 13.82 TOP
~
~
B1_C80(B1_C80)
EXPECTED     ACTUAL
2.15K OHMS   694.92MEG OHMS
LIMITS ARE 2K AND 2.42K OHMS
0699-7498 X/Y= 6.365 2.365 BOTTOM
~
~
:M Component: B2_U5 B2_Q4
EXPECTED     ACTUAL
2K OHMS  183.95MEG OHMS
LIMITS ARE 1.85K AND 2.1K OHMS
0699-8129 X/Y= -1.26 13.82 TOP
~
~
:M Component: U5 => B2_Q7
EXPECTED     ACTUAL
2.15K OHMS   694.92MEG OHMS
LIMITS ARE 2K AND 2.42K OHMS
0699-7498 X/Y= 6.365 2.365 BOTTOM
~
~
C11953(C11953)
EXPECTED     ACTUAL
2K OHMS  183.95MEG OHMS
LIMITS ARE 1.85K AND 2.1K OHMS
0699-8129 X/Y= -1.26 13.82 TOP
~
~
Q31_Q1
EXPECTED     ACTUAL
2.15K OHMS   694.92MEG OHMS
LIMITS ARE 2K AND 2.42K OHMS
0699-7498 X/Y= 6.365 2.365 BOTTOM
~
~
Q80(Q80_Q1)
EXPECTED     ACTUAL
2K OHMS  183.95MEG OHMS
LIMITS ARE 1.85K AND 2.1K OHMS
0699-8129 X/Y= -1.26 13.82 TOP
CHAN A/E: XN1107Y13783[7096]
CHAN B/F: XN1213Y13866[7135]
CHAN C/G/GND: XN1107Y13883[6983]
~
~

The end result I need would be (leave the duplicate list for me if you spend too much time for everything already):

C374
C84
R165
U1
U1
E11
U19
C_3V3
C_3V3
L4
F8
F8
R265
R265
U56_SW1_9_10
U14_SEG1
RP14_R4
RP14_R4
V12P0
V12P0
Q11
Q11
R1085
R1085_2
D1
D18_CR1_CR2
U84
U94
TMP275
U6
U12
R798
R571
R571A2
S1
SW1
Q7_NPN1
P_R30
P_R30
R19
R19
B2_R174
B2_R10
P_R19
P_R19
B1_C80
B1_C80
B2_U5
B2_Q4
U5
B2_Q7
C11953
C11953
Q31_Q1
Q80
Q80_Q1

In general the first alphabet follow by a series of number is the specific reference designator for particular electronic device. You can find the complete list here:

A Assembly
B Blower/motor
C Capacitor
D Diode
E Tie point/test point
F Fuse
G Galvanometer/other
H - ?
I Indicator
J Jack
K Relay
L Inductor
M Motor
O - ?
P Plug
Q Transistor
R Resistor
S Switch
T Transformer
U IC
V Valve (electron tube)
W Cable
X Crystal/Resonator/Subcircuit
Y Crystal
Z - Any network that presents an impedance.

I tried to write the expression in all sort of way that I can think of but still not able to get the things right.

If the log can be extracted for the first time as below:

C374(C84)
R165 FAILED CONTINUITY
U1(U1_CHECK_IDS)
E11 FAILED CONTINUITY
U19 FAILED VENDOR TEST!
C_3V3(C_3V3)
L4 FAILED CONTINUITY
F8(F8_CONT)
R265(R265_CONT)
U56_SW1_9_10_CLOSED
U14_SEG1 FAILED CONTINUITY
RP14_R4(RP14_R4)
V12P0 CAPS(V12P0_CAPS)
Q11(Q11)
R1085(R1085_2)
D1
D18_CR1_CR2
U84
U94 (TMP275) :MFAILED:N.
CHECK U6 & U12 (R798)
R571(R571A2)
S1(SW1_CONT)
Q7_NPN1
P_R30(P_R30_CONT)
R19(R19_CONT)
B2_R174(B2_R10)
P_R19(P_R19)
B1_C80(B1_C80)
:M Component: B2_U5 B2_Q4
:M Component: U5 => B2_Q7
C11953(C11953)
Q31_Q1
Q80(Q80_Q1)

...then to get it extracted once more with \w+\d will get the job done!

In fact, would the end result that I want from the log is covered variety of rules or inconsistent pattern that is difficult for regex?

Sorry if that are too much to read but I just want to make it crystal clear.

M23, if this cost too much of your time I am really sorry and greatly appreciate for your reach out, thank you. ;)

Ps. Just help me with the regular expression part is more than enough.

Edited by guner7

Share this post


Link to post
Share on other sites

Any? :D

Share this post


Link to post
Share on other sites

Would someone please just tell me if what I am asking is possible about the regex? :D

Share this post


Link to post
Share on other sites

guner7,

Patience please - it might be important to you , but it is not to anyone else. :D

I have been looking for an SRE for you, but I have run into some problems as your suggestion of "single letter followed by digits" is not a good pattern:

- You have several double letter results in the list you say you want to retrieve (eg: TMP275, SW1)

- That pattern also matches inside lines when the result is false (eg: 2443 SPD_SLM1_MBA_J15_SA1 23-A052 J15.237 BOTTOM)

- You have required values that start in mid line(eg: M Component: B2_U5 B2_Q4)

So the pattern is not easy to develop.

However, do not lose hope - I have changed the thread title to attract the RegEx gurus and you might get lucky. :huh:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Hi M23, pardon for my impatience and I'm glad that you are looking the solution for me, thanks for the thread title.

I shall wait then....

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

guner7,

This is the best I have come up with so far:

(?i)[Rs(]([a-z][_d][_a-z0-9]{0,})

which gives the following result:

C374
C84
R165
U1
U1_CHECK_IDS
E11
U19
T1
C_3V3
C_3V3
J15
J15
J15
J15
L4
F8
F8_CONT
V1P1_MEM1
X6414Y2348
R265
R265_CONT
U56_SW1_9_10_CLOSED
U14_SEG1
P14_R4
P14_R4
V12P0
V12P0_CAPS
Q11
Q11
R1085
R1085_2
V3P3_STBY
X6414Y2348
D1
D18_CR1_CR2
U84
U94
U6
U12
R798
R571
R571A2
S1
Q7_NPN1
P_R30
P_R30_CONT
R19
R19_CONT
B2_R174
B2_R10
P_R19
P_R19
B1_C80
B1_C80
B2_U5
B2_Q4
U5
B2_Q7
C11953
C11953
Q31_Q1
Q80
Q80_Q1

Any use? :D

M23

Edited by Melba23

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

M23,

That is AMAZING!!

I thank you for your time and appreciated your effort in helping me so far.

I wish I can do as good in regex as you but I guess I'm will not.

I couldn't express how greatly I want to say thank you for all of this. :D

Edited by guner7

Share this post


Link to post
Share on other sites

Hi M23,

It is weird that the expression you defined for me does not work anymore, presently. But I did test it when the day you've just posted and I am sure it works correctly as the result you had posted. But no longer work for now...

Sorry I didn't save the expression from the thread last time. :( Would you look upon it if there is any discrepancy from your original one?

Thank you.

Share this post


Link to post
Share on other sites

guner7,

The forum editor removed some "" from the pattern. :mad:

It should read:

(?i)[Rs(]([a-z][_d][_a-z0-9]{0,})

Does that work for you? :huh:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Yes..it works!! :sweating:

Thanks again M23.

Share this post


Link to post
Share on other sites

#20 ·  Posted (edited)

Hi M23, I have a different question, it is about array. If it should be posted in another new thread, do please move so.

I cannot find anything that I am looking at when searching over the forum.

I have two size of array, $a[4], $b[4].

$a[4]=[a,b,c,d]
$b[4]=[1,2,3,4]

Can I combine them into a 2-dimensional array such as, $c[4][2]: :ermm:

$c[4][2]=[[a,1],[b,2],[c,3],[d,4]]

Thanks.

Edited by guner7

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0