Hi, @scott-fredrick-smith, and All,
OK ! Taking in account, again, my first reges S/R, of my previous post :
So, from your original text, below :
0 AGH111900-1 GENERATOR
1 VA111200G1 GENERATOR ASSEMBLY - TOP LEVEL
2 VA111200P1 GENERATOR ASSEMBLY - HOUSING
2 100629-042 ADHESIVE, ANAEROBIC, LIQUID RESIN
2 200-000-111-112 CONNECTOR
2 200-000-112-004 CONNECTOR CONTACT
2 A50GB0013-1 TAPE, PRESSURE SENSITIVE ADHESIVE- POLYIMIDE
2 AS3236-06 BOLT, MACHINE - DOUBLE HEX HEAD
2 MIL-PRF-7808 PERF.SPEC,LUBRICATING OIL,GR3
2 MS16996-10 SCREW, SOCKET HEAD
2 VA112719P1 GEAR RETAINER
2 VA112719P2 GEAR RETAINER
2 VA112799P2 GROMMET - T2
2 VA112799P3 GROMMET
2 VA112817G1 PLATE - IDENTIFICATION
3 VA112817P1 PLATE - IDENTIFICATION
3 3-011-001 INSULATING CMPD,ELE
3 G11257P6 PLATE-BLANK
3 K34706P1 THINNER, PAINT PRODUCTS
4 S-8 THINNER, PAINT PRODUCTS
3 TD111234 PROCESS SPECIFICATION - SERIALIZATION
2 VA113269P1 COVER - DISCONNECT ASSEMBLY
2 VA113289P1 DISC RETAINER - GEAR
2 VA113448P4 BUSHING - HEATER HOUSING
2 VA113453P1 SHIM - 0.630 OD, 0.200 ID, 0.005 THK
2 VA113453P2 SHIM - 0.630 OD, 0.200 ID, 0.005 Thick
The following regex S/R, named A, which :
Deletes any line which does not contain VA Drawings and is different from the level 0 line
Deletes all the P’s and G’s, followed with digits
SEARCH (?-is)(?!.*VA\d+|^0|^\u)^.+\R|^\d\x20{3}|[GP]\d+
REPLACE Leave EMPTY
So, after clicking, once, on the Replace All button or several times on the Replace button, you should get :
AGH111900-1 GENERATOR
VA111200 GENERATOR ASSEMBLY - TOP LEVEL
VA111200 GENERATOR ASSEMBLY - HOUSING
VA112719 GEAR RETAINER
VA112719 GEAR RETAINER
VA112799 GROMMET - T2
VA112799 GROMMET
VA112817 PLATE - IDENTIFICATION
VA112817 PLATE - IDENTIFICATION
VA113269 COVER - DISCONNECT ASSEMBLY
VA113289 DISC RETAINER - GEAR
VA113448 BUSHING - HEATER HOUSING
VA113453 SHIM - 0.630 OD, 0.200 ID, 0.005 THK
VA113453 SHIM - 0.630 OD, 0.200 ID, 0.005 Thick
Now, with this new second regex S/R, named B, below, you just wipe out all duplicates lines !
SEARCH (?-s)^(\h+(VA\d+)\x20.+\R)(\h+\2.+\R)+
REPLACE \1
After clicking, once, on the Replace All button or several times on the Replace button, here is what you get. Practically, your final text !
AGH111900-1 GENERATOR
VA111200 GENERATOR ASSEMBLY - TOP LEVEL
VA112719 GEAR RETAINER
VA112799 GROMMET - T2
VA112817 PLATE - IDENTIFICATION
VA113269 COVER - DISCONNECT ASSEMBLY
VA113289 DISC RETAINER - GEAR
VA113448 BUSHING - HEATER HOUSING
VA113453 SHIM - 0.630 OD, 0.200 ID, 0.005 THK
Finally, we just have to normalize the indenting spaces, after the VA drawings ( VA\d+ ) to 4 space characters. Thus, this last regex S/R, named C
SEARCH (VA\d+)\x20+
REPLACE \1\x20\x20\x20\x20
Again, after clicking, once, on the Replace All button or several times on the Replace button, you’ll obtain your expected text :
AGH111900-1 GENERATOR
VA111200 GENERATOR ASSEMBLY - TOP LEVEL
VA112719 GEAR RETAINER
VA112799 GROMMET - T2
VA112817 PLATE - IDENTIFICATION
VA113269 COVER - DISCONNECT ASSEMBLY
VA113289 DISC RETAINER - GEAR
VA113448 BUSHING - HEATER HOUSING
VA113453 SHIM - 0.630 OD, 0.200 ID, 0.005 THK
Et voilà :-))
Best Regards,
guy038
P. S. : Next time, I could give you some explanations on these 3 regex S/R ( A, B and C ) !