Jump to content

How to record a specific value in a text


Recommended Posts

Hi everyone :)

I whould like to start coding a new script to do what i never did yet. Record a value in a text in a field of chrome. This is what i ill get inside the field:

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


Bonjour,
********** vous envoie ce message :
erreur orientation vers oper 54 a la place oper 31 comminges
Coordonnées :
- email : ******@orange.fr
- tél. : 06********

I want 5 values :

$Value0=************

$Value1=88

$Value2=Demandeur

$Value3=******@orange.fr

$Value4=06********

 

I dont coded anything yet. Can you guy give me a help on how to start with that ? What i have to look at to do this ? Or even any exemple is welcome :)

Btw the thing that make this script possible to work is the lines of text with these values will never change.

Thanks all !

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

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to post
Share on other sites

Hey @FrancescoDiMuro :) 

I am sorry i cant see anything about guetting a text data in a field or somthing

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

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to post
Share on other sites

@FrancescoDiMuro no i am sorry it s à ticket on our ticketing software that is unreachable from internet.

but i can screen.

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

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to post
Share on other sites

@FrancescoDiMuro

 

5b602fee5dc0c_Sanstitre.thumb.jpg.555648f1e415b84cf06077af22bfc4f6.jpg

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

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to post
Share on other sites

@FrancescoDiMuro

ok :) but when ill got the tag what will make me reg a value in a variable? This is the only point where i need help

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

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to post
Share on other sites

@FrancescoDiMuro

i checked these controls :

 ControlSetText

ControlGetText

But my probleme now is when i have a text like this :

blablablablablabla 090897

How to get 09897 only in my variable ?

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

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to post
Share on other sites

@FrancescoDiMuro

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


Bonjour,
********** vous envoie ce message :
erreur orientation vers oper 54 a la place oper 31 comminges
Coordonnées :
- email : ******@orange.fr
- tél. : 06********

I want the values :

-88

-Demandeur 

-********* (name surname)

-******@orange.fr

-06********

i want to remove all the text arround these values.

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

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to post
Share on other sites

I mean for exemple for the value 88 : 

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

Remove all texte before and after each 8

Or for the value ********* (name surname) get everything whrited before « vous envoie ce message »

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

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to post
Share on other sites

StringRegExp and StringRegExpReplace are very powerful but not needed, if you (same as mine) don't understand to use it. You can use a combination of String* and _StringBetween (using StringRegExp)

Small example for _StringBetween:

#include <Array.au3>
#include <String.au3>


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

$aSplit = StringSplit($sData, @CRLF, 3)
_ArrayDisplay($aSplit)
$sEMail = _GetValueInArray($aSplit, '- email : ')
ConsoleWrite($sEMail & @CRLF)
Global $aData = _StringBetween($aSplit[0], '[', ']')
_ArrayDisplay($aData)

Func _GetValueInArray($aArray, $sInStr)
    Local $sRet = ''
    For $i = 0 To UBound($aArray) - 1
        If StringInStr($aArray[$i], $sInStr) Then
            $sRet = StringReplace($aArray[$i], $sInStr, '')
            ExitLoop
        EndIf
    Next
    Return $sRet
EndFunc   ;==>_GetValueInArray

As you see $aData[1] is 88 and EMail is stored in a var.

dossier.txt

Edited by AutoBert
Link to post
Share on other sites

Ok now i ll start my script i ll come back here for questions thanks guys

@AutoBert where ? :) 

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

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to post
Share on other sites
1 hour ago, AutoBert said:

StringRegExp and StringRegExpReplace are very powerful but not needed, if you (same as mine) don't understand to use it.

Right, but learning regex is never a waste of time  :)

#include <Array.au3>

Global $sData = FileRead('Dossier.txt')
$pattern = '(?s).+?(\d+)\]\[([^\]]+).+?Bonjour,\s+(.+?) vous envoie.+?email : (\N+).+?tél. : (\N+)'
$a = StringRegExp($sData, $pattern, 3)
_ArrayDisplay($a)

 

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

    No registered users viewing this page.

×
×
  • Create New...