Jump to content

Recommended Posts

Posted (edited)

@AutoBert Your exemple is imba :) I am working on it actualy. Thanks for that. Before trying to play with all these functions and variables. Can you help me on what could replace 

Global $sData = FileRead('Dossier.txt')

By somthing that can read all the text in my webpage ? Becose i think there is nothing to do that. 

If i scan my webpage with AU3info 

>>>> Control <<<<
Class:    Chrome_RenderWidgetHostHWND
Instance:    1
ClassnameNN:    Chrome_RenderWidgetHostHWND1
Name:    
Advanced (Class):    [CLASS:Chrome_RenderWidgetHostHWND; INSTANCE:1]
ID:    160547768
Text:    Chrome Legacy Window

Anywhere i click to scan my field i ll got the same results 

 

=====================================================================================

Also i whould like to know : 

If i do 

Global $aData3 = _StringBetween($aSplit[0], '[ANAH][88][', ']')

If the value 88 changing i wont be able to get again the value needed. in our Exemple : [Demandeur]

How to ask to AutoIT to give me the [Demandeur] Value anyway with what is the number between [88] 

Hope i am clear enouth :/ 

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

  Reveal hidden contents

 

Posted (edited)

@AutoBert or @FrancescoDiMuro

Ok then an other question: 

With this line : 

********** vous envoie ce message :

How to get only the stars? 

Becose i tryed that :

Global $aData4 = _StringBetween($aSplit[0], ' ', 'vous envoie')

and that : 

Global $aData4 = _StringBetween($aSplit[0], '', 'vous envoie')

But the return value is empty :'( 

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

  Reveal hidden contents

 

Posted
  On 8/3/2018 at 1:51 PM, mikell said:

Either there's a bug in your script, or you forgot that _StringBetween returns an array

#include <String.au3>
Msgbox(0,"", _StringBetween("********** vous envoie ce message : ", '', ' vous envoie')[0] )

 

Expand  

Yeah it was on purpose. Becose i am keeping the exemple structure. But that work well :P Thanks you man. If you can give me some explanations ... To make me understand how you find that ? 

 

I got an other one that is also complicated for me : 

[ANAH][88][Demandeur][45896_1529768635] Question concernant mon dossier

With that line how to get the value [Demandeur] when 88 can be 01 to 99 

I know how to get it when 88 does not changing. But how to do when it s changing ?

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

  Reveal hidden contents

 

Posted
  On 8/3/2018 at 2:32 PM, caramen said:

If you can give me some explanations ... To make me understand how you find that ? 

Expand  

Hmmm. You've got a helpfile and a (theoretically) working brain
And @AutoBert gave you an example which already contains all needed clues provided that you tried to understand it

#include <String.au3>
$s = "[ANAH][88][Demandeur][45896_1529768635] Question concernant mon dossier "
Msgbox(0,"", _StringBetween($s, '[', ']')[1] & @crlf & _StringBetween($s, '[', ']')[2] )

 

Posted
  On 8/1/2018 at 10:12 AM, AutoBert said:

also right with one exception: if learning regex isn't succesfull.

Expand  

learning how not to regex, is how i learned to regex.  :)

#include<array.au3>

$a = stringsplit(FileRead("test.txt") , "[], " , 2)

local $a2[5] = [$a[16] , $a[3] , $a[5] , $a[35] , $a[38]]

_ArrayDisplay($a2)

 

  Reveal hidden contents

Posted
  On 8/3/2018 at 3:56 PM, mikell said:

Hmmm. You've got a helpfile and a (theoretically) working brain
And @AutoBert gave you an example which already contains all needed clues provided that you tried to understand it

#include <String.au3>
$s = "[ANAH][88][Demandeur][45896_1529768635] Question concernant mon dossier "
Msgbox(0,"", _StringBetween($s, '[', ']')[1] & @crlf & _StringBetween($s, '[', ']')[2] )

 

Expand  

I know it can looks ridiculus to help me when the help is saying everything... But for me it s hard... to understand. Man you give me a very good way to start with... thanks you!!

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

  Reveal hidden contents

 

Posted (edited)

@mikell Man your help was imba :) Here is my script for furter user that whould like to understand easy script for starter... 

 

First of all i was needing that line to do same of you : 

$s = "[ANAH][88][Demandeur][45896_1529768635] Question concernant mon dossier "

So i did that : 

$Ligne = _GetValueInArray($aSplit, '[ANAH]')
$Dep  = _StringBetween($Ligne, '[', ']')[0]
       $Role = _StringBetween($Ligne, '[', ']')[1]

 

1000 Thx. 

@mikell My last question : 

In this line :

blablabla vous envoie ce message :

Particulary if the blablabla can be bliblibli blobloblo or unknow name. 

How to get blablabla in a $variable ?? 

 

Edit:

Answer : 

$pattern = '(?s).+?(\d+)\]\[([^\]]+).+?Bonjour,\s+(.+?) vous envoie.+?email : (\N+).+?tél. : (\N+)'
       $a = StringRegExp($DataLut, $pattern, 3)
       $Nom = $a [2]

 

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

  Reveal hidden contents

 

Posted

@mikell I am learning StringRegExp can you just confirme you used these settings ?

$pattern = '(?s).+?(\d+)\]\[([^\]]+).+?Bonjour,\s+(.+?) vous envoie.+?email : (\N+)'

Mikell or someone else can explain me how to cut this ?

(?s).+?(\d+)\]\[([^\]]+)

So i can find each in help file

I got these

(?s)

.

+?

\d

+

Not the rest

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

  Reveal hidden contents

 

Posted
  On 8/10/2018 at 9:30 AM, caramen said:

How to get blablabla in a $variable ?? 

Expand  

Same way, use _StringBetween

#include <String.au3>
$s = "blablabla vous envoie ce message : "
Msgbox(0,"", _StringBetween($s, "", ' vous envoie')[0] )

It's a pretty nice solution if you don't feel sure with regex
 

  On 8/10/2018 at 3:27 PM, caramen said:

Not the rest

Expand  

OK, here is an example

#include <Array.au3>
$s = "[ANAH][88][Demandeur][45896_1529768635] Question concernant mon dossier "
$a = StringRegExp($s, '\[([^\]]+)\]', 3)
_ArrayDisplay($a)

explanations :
the brackets are escaped when used as literals because they are special characters
In the capturing group, [...] is a character class (refer to the help file), and  ^\]  means "a char which is not a closing bracket"

So literally, the expression \[([^\]]+)\] means : "get one or more chars, included in brackets, which are not a closing bracket"
:)

 

Posted

does seeing it many different ways help?

#include <Array.au3>
$s = "[ANAH][88][Demandeur][45896_1529768635] Question concernant mon dossier "
$a = stringsplit(stringreplace(stringtrimright($s , 1 + StringLen($s) - StringInStr($s , "]" , 0 , -1)) , "[" , "") , "]" , 2)
_ArrayDisplay($a)

 

  Reveal hidden contents

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...