Jump to content

StringRegExp help


faustf
 Share

Recommended Posts

hi guys  i did do a little script

for  clean and modify a code  , born of KODA   this script is this

#include <FileConstants.au3>
#include <MsgBoxConstants.au3>
#include <WinAPIFiles.au3>
#include <File.au3>
#include <Array.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>


Opt("GUIOnEventMode", 1)

Global $Input1, $Input2, $Input3, $Input4

_Gui()

Func _Gui()
    $Form2 = GUICreate("Form2", 413, 226, 302, 218)
    $Group1 = GUICtrlCreateGroup("File da trattare", 0, 160, 412, 57)
    $Button1 = GUICtrlCreateButton("Apri", 303, 188, 75, 21)
    $Input2 = GUICtrlCreateInput("C:\Users\utente\Desktop\automatic_write_4_autoit\sorgente.txt", 23, 188, 249, 21)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Group2 = GUICtrlCreateGroup("Opzioni", 0, 84, 412, 77)
    $Checkbox1 = GUICtrlCreateCheckbox("Commento OFF", 245, 101, 97, 15)
    $Input1 = GUICtrlCreateInput("$GUI_Lang[", 13, 130, 153, 21)
    $Label1 = GUICtrlCreateLabel("Nomi ", 19, 112, 31, 17)
    $Checkbox2 = GUICtrlCreateCheckbox("Distructor OFF", 245, 118, 97, 15)
    $Checkbox3 = GUICtrlCreateCheckbox("Variabili OFF", 245, 136, 97, 15)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Button2 = GUICtrlCreateButton("Start", 327, 26, 75, 21)
    $Input3 = GUICtrlCreateInput("$SITIWEB_NIMLTY_eBay_", 8, 26, 305, 21)
    $Label2 = GUICtrlCreateLabel("Suffisso da sostituire", 24, 8, 100, 17)
    $Input4 = GUICtrlCreateInput("C:\_GESTIONALE_NEW\CONFIGURE\language\Gui\Italian.lang", 121, 63, 281, 21)
    $Label3 = GUICtrlCreateLabel("Percorso File lingua:", 16, 64, 99, 17)
    GUISetState(@SW_SHOW)


    GUISetOnEvent($GUI_EVENT_CLOSE, "_close")
    GUICtrlSetOnEvent($Button2, _start)

EndFunc   ;==>_Gui
#EndRegion ### END Koda GUI section ###

Func _start()
    FileDelete("C:\Users\utente\Desktop\automatic_write_4_autoit\File_lingua.txt")
    FileDelete("C:\Users\utente\Desktop\automatic_write_4_autoit\File_sorgente_new.txt")
    FileDelete("C:\Users\utente\Desktop\automatic_write_4_autoit\File_Destruct.txt")
    Local $sLSuffixLanguage = GUICtrlRead($Input1)
    Local $sLSuffix = GUICtrlRead($Input3)
    Local $aLTextElaborate = FileReadToArray(GUICtrlRead($Input2))
    ;_ArrayDisplay($aLTextElaborate,'47')
    For $i = 0 To UBound($aLTextElaborate) - 1
        Local $sLChar = StringLeft($aLTextElaborate[$i], 1)
        If $sLChar <> "$" Then
            $aLTextElaborate[$i] = ""
        EndIf
    Next
    $aLTextElaborate = _Remove_BlankIN_Array($aLTextElaborate)
    ;=============================================== SOSTITUZIONE $ VARIABILE RINOMINA ======================================
    ;_ArrayDisplay($aLTextElaborate)
    For $i = 0 To UBound($aLTextElaborate) - 1
        Local $sLOutput = StringRegExpReplace($aLTextElaborate[$i], '(?i)[\$]', $sLSuffix)
        ;MsgBox(0,'51',$sLOutput)
        Local $aLtesti = StringRegExp($sLOutput, '(?i)"(.*?)"', $STR_REGEXPARRAYGLOBALMATCH)
        ;_ArrayDisplay($aLtesti)
        ;====================================================================================================================
        ;=================================== COMMENTO ; ===================================================================
        If $aLtesti[0] <> "" Then
            _True_write_File("C:\Users\utente\Desktop\automatic_write_4_autoit\File_lingua.txt", $aLtesti[0])
            Local $sLFondoComment = StringRegExpReplace($sLOutput, '(?i)[\)]', ') ; ' & $aLtesti[0])
        Else
            Local $sLFondoComment = StringRegExpReplace($sLOutput, '(?i)[\)]', ')')
        EndIf
        ;======================================================================================================================
        ;==================================SUFFISSI ARRAY PER LINGUA =======================================================

        Local $sLChar4lang = StringRight($sLFondoComment, 1)
        If $sLChar4lang <> ")" Then
            If $aLtesti[0] <> "" Then

                Local $aLLanguageALL=FileReadToArray("C:\_GESTIONALE_NEW\CONFIGURE\language\Gui\Italian.lang")
                ;Local $iCountLines = _FileCountLines(@ScriptFullPath)
                For $j = 0 To UBound($aLLanguageALL)-1
                    ;MsgBox(0,"",$aLtesti[0]&"   ---  "& $aLLanguageALL[$j])
; ^upload\r\n
                    Local $found2 = StringInStr($aLLanguageALL[$j],$aLtesti[0])
                    Local $a = $j
                    $a +=1
                    If $found2 <> 0  Then
                    MsgBox(0,'found2',$aLtesti[0]&' @@@@@ '&$a)
                    EndIf
                Next
            EndIf
            Local $sLReady = StringRegExpReplace($sLFondoComment, '(?i)"(.*?)"', $sLSuffixLanguage&"]")

        Else
            Local $sLReady = StringRegExpReplace($sLFondoComment, '(?i)"(.*?)"', '""')
        EndIf
            ;======================================================================================================================
        _True_write_File("C:\Users\utente\Desktop\automatic_write_4_autoit\File_sorgente_new.txt", $sLReady)

    Next
    MsgBox(0, 'Info', 'Fine processo 1')
    Local $aLNew_source = FileReadToArray("C:\Users\utente\Desktop\automatic_write_4_autoit\File_sorgente_new.txt")

    Local $aLClone[UBound($aLNew_source)]
    For $i = 0 To UBound($aLNew_source) - 1
        Local $aLtesti = StringRegExp($aLNew_source[$i], '(?i)(.*?) = ', $STR_REGEXPARRAYGLOBALMATCH)
        ;_ArrayDisplay($aLtesti)
        $aLClone[$i] = $aLtesti[0]
        _True_write_File("C:\Users\utente\Desktop\automatic_write_4_autoit\File_Destruct.txt", "GUICtrlDelete(" & $aLtesti[0] & ")")
    Next
    For $i = 0 To UBound($aLClone) - 1
        _True_write_File("C:\Users\utente\Desktop\automatic_write_4_autoit\File_Variabili.txt", $aLClone[$i])
    Next

    Global $array[6]
    Global $file_tot_gui = _FileCountLines("C:\Users\utente\Desktop\automatic_write_4_autoit\File_Variabili.txt")
    MsgBox(0, 'Info', $file_tot_gui)
    Global $b = 1
    Global $a = 1
    _5_a_riga()

    Local $aLLanguageORIG = FileReadToArray(GUICtrlRead($Input4))
    ;_ArrayDisplay($aLLanguageORIG, '105')
     $aLLanguageORIG = _Remove_BlankIN_Array($aLLanguageORIG)
     Local $aLnewLang = FileReadToArray("C:\Users\utente\Desktop\automatic_write_4_autoit\File_lingua.txt")
     #cs
     For $j=0 To UBound($aLLanguageORIG) -1
     For $i=0 To UBound($aLnewLang)-1
         If $aLLanguageORIG[$j] <>
     Next
     Next
     #ce
    Local    $found
    For $i = 0 To UBound($aLLanguageORIG)-1
        $found = _ArraySearch($aLnewLang, $aLLanguageORIG[$i])
        ;MsgBox(0,'',$found)
        If $found <> "-1" Then
       ; ConsoleWrite("Array1[" & $i & "] = Array2[" & $found & "] : " & $aLLanguageORIG[$i] & "=" & $aLnewLang[$found] & @LF)
        Else
        ConsoleWrite($aLLanguageORIG[$i]&@LF)
        EndIf
    Next
EndFunc   ;==>_start

Func _5_a_riga()

    Local $hFileOpen = FileOpen("C:\Users\utente\Desktop\automatic_write_4_autoit\File_Variabili.txt", $FO_READ)
    Do


        Local $sFileRead = FileReadLine($hFileOpen, $a)

        $array[$b] = $sFileRead

        If Mod($b, 5) = 0 Then
            FileWrite("C:\Users\utente\Desktop\automatic_write_4_autoit\File_Variabili.txt", "Global " & $array[1] & "," & $array[2] & "," & $array[3] & "," & $array[4] & "," & $array[5] & @CRLF)
            $b = 0
        EndIf


        $b += 1
        $a += 1

    Until $a = ($file_tot_gui + 1)


EndFunc   ;==>_5_a_riga
; #INDEX# ========================================================================
; Title .........: GUI_Configure.au3
; AutoIt Version : 3.3.14.2++
; Language ......: Italian
; Description ...: A collection of Function for Logic of Gest
; Author ........: Faustf
; What do you do.: Remove Blank in array 1d
; Version .......: 0.0.1 BETA - Work in progress 15/03/2016
; Syntax ........:
; ================================================================================

Func _Remove_BlankIN_Array($arr_2)

    For $i = UBound($arr_2) - 1 To 0 Step -1
        If $arr_2[$i] = "" Then
            _ArrayDelete($arr_2, $i)
        EndIf
    Next
    Return $arr_2
EndFunc   ;==>_Remove_BlankIN_Array
; #INDEX# ========================================================================
; Title .........: GUI_Configure.au3
; AutoIt Version : 3.3.14.2++
; Language ......: Italian
; Description ...: A collection of Function for Logic of Gest
; Author ........: Faustf
; What do you do.: Write data in File
; Version .......: 0.0.1 BETA - Work in progress 15/03/2016
; Syntax ........:
; ================================================================================

Func _True_write_File($sFilePath, $sDataWrite, $iReturn = 0)
    If $iReturn = Default Then $iReturn = 0

    $file = FileOpen($sFilePath, 1)
    If $iReturn = 0 Then
        FileWrite($file, $sDataWrite & @CRLF)
    Else
        FileWrite($file, $sDataWrite)
    EndIf
    FileClose($file)

EndFunc   ;==>_True_write_File
While 1
    Sleep(100)
WEnd
Func _close()
    Exit
EndFunc   ;==>_close

in block suffissi array per lingua

i want  find a word  for compare and if exist must return a number of line  (because after i want inser in $GUI_Lang[ number ]), but problem is with stringinstr  return also a frases.

example  if  in list of find  i  have  ,  and i want find upload  

upload

ftp upload

search

upload after

string instr  match  all  3 upload , i thinked   with regexp is possible

but how???  some one can help me ??  thankz

 

 

 

Link to comment
Share on other sites

  • Moderators

faustf,

Like this:

#include <MsgBoxConstants.au3>

; Simulate reading file into array
Local $aLines[] = ["ftp upload", "search", "upload after", "upload", "blahblah"] ; Should get line 4 returned

; Set required string to find
$sTarget = "upload"

; Now look for the string in the file and return the line number
For $i = 0 To UBound($aLines) - 1
    ; Now look for a line which matches the target - using the ^ $ anchors means that the other lines containing the string do NOT match
    If StringRegExp($aLines[$i], "^" & $sTarget & "$") Then
        ; And we need to add 1 to the index to get the line number
        MsgBox($MB_SYSTEMMODAL, "Found it!", $sTarget & " is on line " & $i + 1)
    EndIf
Next

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
Share on other sites

  • Moderators

faustf,

Just set $sTarget to the string you wish to find:

#include <MsgBoxConstants.au3>

; Simulate reading file into array
Local $aLines[] = ["ftp upload", "search", "upload after", "upload", "<----"] ; Should get line 5 returned

; Set required string to find
$sTarget = "<----"

; Now look for the string in the file and return the line number
For $i = 0 To UBound($aLines) - 1
    ; Now look for a line which matches the target - using the ^ $ anchors means that the other lines containing the string do NOT match
    If StringRegExp($aLines[$i], "^" & $sTarget & "$") Then
        ; And we need to add 1 to the index to get the line number
        MsgBox($MB_SYSTEMMODAL, "Found it!", $sTarget & " is on line " & $i + 1)
    EndIf
Next

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
Share on other sites

mmm not  work good my script  i show  you

this is my language file

Ragione Sociale
Via
Città
Cell
Mail
Provincia
Telefono
Cod.Fi.
P.iva
CAP.
Fax
Inserisci
Sede Legale
Configurazione Azienda e Documenti
Sede Operativa
Se Uguale:
Loghi Fattura
Logo Azienda
Scegli
Carica
(Max. 4288x2848)
(Max. 300 dpi)
Costi
Diritto di Chiamata Aziendale
Setta
Costo Orario Aziendale
Costo Orario Privato
Iva in corso %
Ricarico Minimo
Diritto di Chiamata Privato
Fattura Tipo Documento
Cerca
Aggiungi
Modalità di pagamento
DDT. Tipo Documento
Tipologia Documento
Dati Connessione DB
Permessi Utenti
Creazione e Modifica Utenti
Nome Utente
Login
Password
Invia Dati
Salva
Info
Non cè :( 
Nessun File Selezionato!
Operazione eseguita con Sucesso
Errore
Inserisci il percorso 
Devi inserire un numero !!
Tipologie di Quantità
Nome Utente
Anagrafiche Clienti
Nome e/o Ragione Sociale
Cognome
Stato
Anagrafica
Elimina
<--- Carica
Cliente Sede Operativa
Cliente Sede Legale
Id DB
Errore devi selezionare un cliente prima di premere il tasto 
Sei Sicuro di volerlo Cancellare ?
Italia
Reset
Magazzino Reale
Inserimento Prodotti o Servizi
Codice Prodotto
Q.tita
N.° Fattura Acquisto
Nome Prodotto e Servizio
Nome distributore
Spesa Incasso
Prezzo a me unitario
% Ricarico
Prezzo + Iva
Codice a Barre
Importazione Ocr
Scansione
Importa
Spesa Trasp.
Spesa Assicurz.
Diriti di comm.
Modalità Preformattazione testo Premere ESC per Uscire
Sintassi corretta \Barcode\Codice prodotto\Descrizione prodotto\Quantità\Prezzo\
Ricalcola
Modifica
Cancella
Fatt.Acq.
Cod.Barre
Cod.Prod.
Descrizione
Q.tà
Prezzo a Me
% ricarico
Data Carico
Cod.Distrib.
Configura
eBay
Registrazione
Utenti
---Registrazione solo eBay
---Registrazione solo mail
ID List
Utente Standard
Reg. Utente
Devi Flaggare Uno dei Ceckbox Presenti
Devi Flaggare Solo uno dei Checkbox Presenti
Parametri eBay
eBay Site
Use Default
Devi Inserire un utente e una password per il sito di eBay
Setta almeno un Fake user
Devi settare i Fake user con il flag Verde
Prodotti in Vendita
Apri inserzione nel browser
Crea nuova inserzione
Venduti
Non Venduti
Storico
Acquistati
Compralo Subito
Asta
NON PAGATO !!
Pagamento in sospeso
Pagato PayPal
Spedizioni eBay
In sped.
Ricarica
Non ci sono Prodotti Venduti
Non ci sono Prodotti in Vendita
Non ci sono Prodotti  non Venduti
Carica tutti gli account contemporaneamente
Prodotto già inserito
Crea Sped.
Non ci sono prodotti in lista
Devi flaggare almeno un prodotto 
Non ci sono prodotti da spedire nel DataBase
Non ci sono i dati del compratore
Peso in Kg
Altezza in centimetri
Lunghezza in centimetri
Profondita in centimetri
Inserisci dati Peso altezza lunghezza profondità
Quanti pacchi
Vuoi scegliere a mano la spedizione che preferisci ?
Devi inserire almeno una parola
Suggerimento parole. SEO
Genera Token
Registrazione solo PayPal
Peso
H
L
P
Colli
Conf
Ins.
Buste
Pacchi
Pallets
Indirizzo
Nome Mittente
Triangola
Puoi fare fino a 4 spedizioni alla volta
Puoi fare fino a 7 spedizioni alla volta
Nuovo Prodotto
Titolo massimo 80 caratteri
Cerca Ctgr.
Categoria
Config. Site
Descrizione Breve massimo 1000 caratteri
Pubblica su tutti
Spiegazione Formato tipo di vendita
Path
Copia Link a Web
Apri Cartella
<-?
Condizioni
Descrizione Completa
Add Firma
Mod Firma
Apri Editor
link formed
Upload
Spiegazione tipo di condizioni
Formato
Prezzo di partenza
Prezzo di riserva
Q.tta
Server Ftp remoto
Pubblica: 
Taglie
?
Devi inserire un prodotto
Seleziona Categoria eBay
Categorie
Inserisci e Cerca
Torna indietro
Tutti
Imposta
Configurazione inserimento piu siti
Seleziona Cartella
Nessuna Cartella Selezionata
Relista le foto
Vai avanti
Syncro
Selez.Tutto
Linka
Giorni Pubblicabili 
Inserisci descrizione
Non  ci sono cartelle 
Fine upload
Devi selezionare  delle foto da uplodare
Devi selezionare qualcosa
Opzioni
Opzioni standard
Opzioni Custom
Immagini
Immagini Sul Server
Copia
Quante Opzioni Custom desideri inserire?
Copia Link x Web
T.I.S.
Tempi di imballaggio per spedizioni 
Giorni Pubblicabili 
Asta online 1 prodotto
Asta online + prodotti
Asta online Live
Pubblicità con interesse
Compralo Subito Ditte
Offerta al secondo
Colori
Pubblicità
Immagini inserzione
Reso si
Inserisci 1°step
Inserisci 2°step
SKU dichiari:
eBay configurazioni globali
Apri conf
Scarica
Senza prezzo spedizione
Apri
Inserisci 1 Step
Sposta
Inserisci 2 Step
Opzioni Standard
Select All
Hai già premuto il tasto attendi
Fine inserimento
Reinsert
Reinsert+foto
Cambia Foto
Location Foto
Upload FTP
Inserisci Variazioni
Le foto nelle variazioni sono n.
Le Foto nelle variazioni sono cambiate ora devi inserire le foto nel corpo inserzione XML e nel corpo HTML
Le Foto nell'inserzione sono state cambiate ,  devi cambiarele nel corpo html
Hai flaggato troppe immagini puoi caricare fino ad un massimo di 12 , carichero solo  le prime 12 
Elimina in DB.
Selez. Tutti
non  ci sono cartelle 
Prodotto inserito correttamente
Conteggio
Ok
Esci
Totale:
Prodotto inserito in eBay Correttamente
Inserito con Successo
Devi inserire una descrizione
Devi inserire  qualcosa prima di premere il tasto
ci sono troppe righe devi farne solo 4 
ATTENZIONE !!!  dovrai pagare la tariffa  se inserirai piu di una foto con questa categoria che hai scelto
Token Generato e Salvato
Caricato l'utente fake:  
Caricato l'utente Default:  
Rim N. 
Devi inserire il nome della Nuova Cartella
Crea Cartella
La categoria che Hai scelto ti permette di inserire Gratuitamente solo una foto in ebay , (non nel corpo HTML dell'inserzione), cosa vuoi fare??, premendo il tasto No continui l'insersione inserendo automaticamente solo una foto
Devi inserire almeno un titolo di massimo 80 caratteri
Devi inserire una descrizione nel corpo dell'inserzione
Non hai flaggato l'utente fake per registrare, ne l'ID list, oppure volevi registrare l'utente standar?? in quel caso devi flaggare solo utente standard
Devi Flaggare anche un utente Fake
Devi Flaggare anche ID list
Regole di Spedizione
le Varianti sono: 
Token Rigenerato e Salvato
devi selezionare: << ALL Tutti >>
Salva Bozza
Nuova Inserzione Multipla
Inserzioni Multiple
Upload
<----
---->
Formati Standard
1
Colori
Associa
Correttore
1° Prodotto
2° Prodotto
3° Prodotto
4° Prodotto
5° Prodotto
6° Prodotto
7° Prodotto
8° Prodotto
9° Prodotto
10° Prodotto
11° Prodotto
12° Prodotto
13° Prodotto
Sfoglia

and this is my  code  for elaborate

$Group4 = GUICtrlCreateGroup("Group3", 5, 71, 1682, 693)
$Group6 = GUICtrlCreateGroup("", 679, 80, 997, 509)
$Button44 = GUICtrlCreateButton("Upload", 687, 154, 67, 21)
$Button55 = GUICtrlCreateButton("<----", 691, 191, 22, 17)
$Button56 = GUICtrlCreateButton("---->", 730, 191, 22, 17)
$Button16 = GUICtrlCreateButton("Copia Link a Web", 690, 220, 99, 21)
GUICtrlSetBkColor(-1, 0xFFFF00)
$Button20 = GUICtrlCreateButton("Immagini inserzione", 689, 253, 101, 21)
$Button25 = GUICtrlCreateButton("Select All", 690, 282, 67, 21)
$List2 = GUICtrlCreateList("", 799, 146, 377, 279)
$Input5 = GUICtrlCreateInput("", 804, 114, 153, 21)
$Label11 = GUICtrlCreateLabel("Location Foto", 804, 94, 69, 17)
$Button13 = GUICtrlCreateButton("Path", 965, 114, 75, 21)
$Button14 = GUICtrlCreateButton("Apri Cartella", 1045, 114, 75, 21)
$Button54 = GUICtrlCreateButton("Button7", 1128, 97, 41, 39, $BS_ICON)
GUICtrlSetImage(-1, "C:\Users\utente\Downloads\Custom-Icon-Design-Pretty-Office-11-New.ico", -1)
$Label13 = GUICtrlCreateLabel("Descrizione Completa", 1363, 91, 106, 17)
$Button31 = GUICtrlCreateButton("Apri Editor", 1360, 115, 67, 21)
$Button43 = GUICtrlCreateButton("Inserisci descrizione", 1431, 115, 108, 21)
GUICtrlSetBkColor(-1, 0xFFFF00)
$Combo6 = GUICtrlCreateCombo("Combo6", 1547, 115, 115, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
$Label20 = GUICtrlCreateLabel("Formati Standard", 1571, 91, 84, 17)
$Edit2 = GUICtrlCreateEdit("", 1182, 147, 483, 116, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN))
GUICtrlSetData(-1, "Edit1")
$Checkbox5 = GUICtrlCreateCheckbox("Add Firma", 1519, 271, 75, 17)
$Button15 = GUICtrlCreateButton("Mod Firma", 1603, 266, 61, 21)
$Label12 = GUICtrlCreateLabel("Condizioni", 1181, 332, 52, 17)
$Combo5 = GUICtrlCreateCombo("Combo5", 1181, 351, 105, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
$Button53 = GUICtrlCreateButton("?", 1294, 352, 19, 17)
$Label7 = GUICtrlCreateLabel("eBay Site", 1327, 333, 49, 17)
$Combo4 = GUICtrlCreateCombo("Combo4", 1327, 351, 145, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
$Checkbox4 = GUICtrlCreateCheckbox("Pubblica su tutti", 1484, 355, 97, 17)
$Button12 = GUICtrlCreateButton("Config. Site", 1592, 351, 67, 21)
$Combo8 = GUICtrlCreateCombo("Combo8", 1181, 399, 105, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
$Label14 = GUICtrlCreateLabel("Formato", 1185, 380, 42, 17)
$Button52 = GUICtrlCreateButton("<-?", 1292, 401, 22, 17)
$Label15 = GUICtrlCreateLabel("Prezzo di partenza", 1339, 380, 91, 17)
$Input6 = GUICtrlCreateInput("", 1333, 399, 97, 21)
$Label16 = GUICtrlCreateLabel("Prezzo di riserva", 1436, 380, 81, 17)
$Input7 = GUICtrlCreateInput("", 1434, 399, 89, 21)
$Label17 = GUICtrlCreateLabel("Compralo subito", 1533, 380, 79, 17)
$Input8 = GUICtrlCreateInput("", 1527, 399, 89, 21)
$Label18 = GUICtrlCreateLabel("Q.tta", 1624, 380, 27, 17)
$Input9 = GUICtrlCreateInput("1", 1620, 399, 41, 21)
$Checkbox6 = GUICtrlCreateCheckbox("Reso si ", 1603, 441, 57, 17)
$Input11 = GUICtrlCreateInput("1", 1569, 435, 19, 21)
$Combo9 = GUICtrlCreateCombo("Combo8", 1392, 435, 135, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
$Label22 = GUICtrlCreateLabel("T.I.S.", 1536, 441, 30, 17)
$Label21 = GUICtrlCreateLabel("Pubblica:", 1339, 441, 48, 17)
$Button48 = GUICtrlCreateButton("Colori", 1263, 434, 59, 21)
$Label25 = GUICtrlCreateLabel("Regole di Spedizione", 691, 425, 104, 17)
$List6 = GUICtrlCreateList("", 691, 443, 478, 123)
$Button26 = GUICtrlCreateButton("Associa", 1587, 538, 75, 21)
$Group20 = GUICtrlCreateGroup("Correttore", 1179, 462, 273, 119)
$Checkbox7 = GUICtrlCreateCheckbox("1° Prodotto", 1187, 481, 73, 17)
$Checkbox8 = GUICtrlCreateCheckbox("2° Prodotto", 1187, 500, 73, 17)
$Checkbox9 = GUICtrlCreateCheckbox("3° Prodotto", 1187, 519, 73, 17)
$Checkbox10 = GUICtrlCreateCheckbox("4° Prodotto", 1187, 538, 73, 17)
$Checkbox11 = GUICtrlCreateCheckbox("5° Prodotto", 1187, 558, 73, 17)
$Checkbox12 = GUICtrlCreateCheckbox("6° Prodotto", 1276, 480, 73, 17)
$Checkbox13 = GUICtrlCreateCheckbox("7° Prodotto", 1276, 499, 73, 17)
$Checkbox14 = GUICtrlCreateCheckbox("8° Prodotto", 1276, 518, 73, 17)
$Checkbox15 = GUICtrlCreateCheckbox("9° Prodotto", 1276, 537, 73, 17)
$Checkbox16 = GUICtrlCreateCheckbox("10° Prodotto", 1276, 557, 81, 17)
$Checkbox17 = GUICtrlCreateCheckbox("11° Prodotto", 1362, 480, 81, 17)
$Checkbox18 = GUICtrlCreateCheckbox("12° Prodotto", 1362, 499, 81, 17)
$Checkbox19 = GUICtrlCreateCheckbox("13° Prodotto", 1362, 518, 81, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group5 = GUICtrlCreateGroup("", 1524, 725, 74, 28, BitOR($GUI_SS_DEFAULT_GROUP,$BS_FLAT))
$Label23 = GUICtrlCreateLabel("Ins Free N.28 ", 1528, 736, 66, 12)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button45 = GUICtrlCreateButton("Inserisci", 1604, 732, 75, 21)
$Group7 = GUICtrlCreateGroup("1° Prodotto", 8, 96, 329, 121)
$Label5 = GUICtrlCreateLabel("Titolo massimo 80 caratteri", 14, 116, 129, 17)
$Label6 = GUICtrlCreateLabel("80", 158, 116, 16, 17)
$Button51 = GUICtrlCreateButton("?", 240, 119, 18, 17)
$Button50 = GUICtrlCreateButton("Sfoglia", 269, 140, 58, 21)
$Input3 = GUICtrlCreateInput("", 14, 140, 248, 21)
$Label8 = GUICtrlCreateLabel("Categoria", 14, 170, 49, 17)
$Input4 = GUICtrlCreateInput("", 14, 188, 248, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group8 = GUICtrlCreateGroup("2° Prodotto", 8, 220, 329, 121)
$Label9 = GUICtrlCreateLabel("Titolo massimo 80 caratteri", 14, 240, 129, 17)
$Label10 = GUICtrlCreateLabel("80", 158, 240, 16, 17)
$Button24 = GUICtrlCreateButton("?", 240, 243, 18, 17)
$Button27 = GUICtrlCreateButton("Sfoglia", 269, 264, 58, 21)
$Input10 = GUICtrlCreateInput("", 14, 264, 248, 21)
$Label19 = GUICtrlCreateLabel("Categoria", 14, 294, 49, 17)
$Input12 = GUICtrlCreateInput("", 14, 312, 248, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group9 = GUICtrlCreateGroup("3° Prodotto", 8, 344, 329, 121)
$Label24 = GUICtrlCreateLabel("Titolo massimo 80 caratteri", 14, 364, 129, 17)
$Label26 = GUICtrlCreateLabel("80", 158, 364, 16, 17)
$Button28 = GUICtrlCreateButton("?", 240, 367, 18, 17)
$Button29 = GUICtrlCreateButton("Sfoglia", 269, 388, 58, 21)
$Input13 = GUICtrlCreateInput("", 14, 388, 248, 21)
$Label27 = GUICtrlCreateLabel("Categoria", 14, 418, 49, 17)
$Input14 = GUICtrlCreateInput("", 14, 436, 248, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group10 = GUICtrlCreateGroup("6° Prodotto", 343, 96, 329, 121)
$Label28 = GUICtrlCreateLabel("Titolo massimo 80 caratteri", 349, 116, 129, 17)
$Label29 = GUICtrlCreateLabel("80", 493, 116, 16, 17)
$Button30 = GUICtrlCreateButton("?", 575, 119, 18, 17)
$Button32 = GUICtrlCreateButton("Sfoglia", 604, 140, 58, 21)
$Input15 = GUICtrlCreateInput("", 349, 140, 248, 21)
$Label30 = GUICtrlCreateLabel("Categoria", 349, 170, 49, 17)
$Input16 = GUICtrlCreateInput("", 349, 188, 248, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group11 = GUICtrlCreateGroup("7° Prodotto", 343, 220, 329, 121)
$Label31 = GUICtrlCreateLabel("Titolo massimo 80 caratteri", 349, 240, 129, 17)
$Label32 = GUICtrlCreateLabel("80", 493, 240, 16, 17)
$Button33 = GUICtrlCreateButton("?", 575, 243, 18, 17)
$Button34 = GUICtrlCreateButton("Sfoglia", 604, 264, 58, 21)
$Input17 = GUICtrlCreateInput("", 349, 264, 248, 21)
$Label33 = GUICtrlCreateLabel("Categoria", 349, 294, 49, 17)
$Input18 = GUICtrlCreateInput("", 349, 312, 248, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group12 = GUICtrlCreateGroup("8° Prodotto", 343, 344, 329, 121)
$Label34 = GUICtrlCreateLabel("Titolo massimo 80 caratteri", 349, 364, 129, 17)
$Label35 = GUICtrlCreateLabel("80", 493, 364, 16, 17)
$Button35 = GUICtrlCreateButton("?", 575, 367, 18, 17)
$Button36 = GUICtrlCreateButton("Sfoglia", 604, 388, 58, 21)
$Input19 = GUICtrlCreateInput("", 349, 388, 248, 21)
$Label36 = GUICtrlCreateLabel("Categoria", 349, 418, 49, 17)
$Input20 = GUICtrlCreateInput("", 349, 436, 248, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group13 = GUICtrlCreateGroup("4° Prodotto", 8, 467, 329, 122)
$Label37 = GUICtrlCreateLabel("Titolo massimo 80 caratteri", 14, 487, 129, 17)
$Label38 = GUICtrlCreateLabel("80", 158, 487, 16, 17)
$Button37 = GUICtrlCreateButton("?", 240, 490, 18, 17)
$Button38 = GUICtrlCreateButton("Sfoglia", 269, 511, 58, 21)
$Input21 = GUICtrlCreateInput("", 14, 511, 248, 21)
$Label39 = GUICtrlCreateLabel("Categoria", 14, 541, 49, 17)
$Input22 = GUICtrlCreateInput("", 14, 559, 248, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group14 = GUICtrlCreateGroup("5° Prodotto", 8, 591, 329, 121)
$Label40 = GUICtrlCreateLabel("Titolo massimo 80 caratteri", 14, 611, 129, 17)
$Label41 = GUICtrlCreateLabel("80", 158, 611, 16, 17)
$Button39 = GUICtrlCreateButton("?", 240, 614, 18, 17)
$Button40 = GUICtrlCreateButton("Sfoglia", 269, 635, 58, 21)
$Input23 = GUICtrlCreateInput("", 14, 635, 248, 21)
$Label42 = GUICtrlCreateLabel("Categoria", 14, 665, 49, 17)
$Input24 = GUICtrlCreateInput("", 14, 683, 248, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group15 = GUICtrlCreateGroup("9° Prodotto", 343, 467, 329, 122)
$Label43 = GUICtrlCreateLabel("Titolo massimo 80 caratteri", 349, 487, 129, 17)
$Label44 = GUICtrlCreateLabel("80", 493, 487, 16, 17)
$Button41 = GUICtrlCreateButton("?", 575, 490, 18, 17)
$Button42 = GUICtrlCreateButton("Sfoglia", 604, 511, 58, 21)
$Input25 = GUICtrlCreateInput("", 349, 511, 248, 21)
$Label45 = GUICtrlCreateLabel("Categoria", 349, 541, 49, 17)
$Input26 = GUICtrlCreateInput("", 349, 559, 248, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group16 = GUICtrlCreateGroup("10° Prodotto", 343, 592, 329, 121)
$Label46 = GUICtrlCreateLabel("Titolo massimo 80 caratteri", 349, 612, 129, 17)
$Label47 = GUICtrlCreateLabel("80", 493, 612, 16, 17)
$Button46 = GUICtrlCreateButton("?", 575, 615, 18, 17)
$Button49 = GUICtrlCreateButton("Sfoglia", 604, 636, 58, 21)
$Input27 = GUICtrlCreateInput("", 349, 636, 248, 21)
$Label48 = GUICtrlCreateLabel("Categoria", 349, 666, 49, 17)
$Input28 = GUICtrlCreateInput("", 349, 684, 248, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group17 = GUICtrlCreateGroup("11° Prodotto", 679, 593, 330, 121)
$Label49 = GUICtrlCreateLabel("Titolo massimo 80 caratteri", 685, 613, 129, 17)
$Label50 = GUICtrlCreateLabel("80", 829, 613, 16, 17)
$Button57 = GUICtrlCreateButton("?", 911, 616, 18, 17)
$Button58 = GUICtrlCreateButton("Sfoglia", 940, 637, 58, 21)
$Input29 = GUICtrlCreateInput("", 685, 637, 248, 21)
$Label51 = GUICtrlCreateLabel("Categoria", 685, 667, 49, 17)
$Input30 = GUICtrlCreateInput("", 685, 685, 248, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group18 = GUICtrlCreateGroup("12° Prodotto", 1013, 593, 330, 121)
$Label52 = GUICtrlCreateLabel("Titolo massimo 80 caratteri", 1019, 613, 129, 17)
$Label53 = GUICtrlCreateLabel("80", 1163, 613, 16, 17)
$Button59 = GUICtrlCreateButton("?", 1245, 616, 18, 17)
$Button60 = GUICtrlCreateButton("Sfoglia", 1274, 637, 58, 21)
$Input31 = GUICtrlCreateInput("", 1019, 637, 248, 21)
$Label54 = GUICtrlCreateLabel("Categoria", 1019, 667, 49, 17)
$Input32 = GUICtrlCreateInput("", 1019, 685, 248, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group19 = GUICtrlCreateGroup("13° Prodotto", 1347, 593, 330, 121)
$Label55 = GUICtrlCreateLabel("Titolo massimo 80 caratteri", 1353, 613, 129, 17)
$Label56 = GUICtrlCreateLabel("80", 1497, 613, 16, 17)
$Button61 = GUICtrlCreateButton("?", 1579, 616, 18, 17)
$Button62 = GUICtrlCreateButton("Sfoglia", 1608, 637, 58, 21)
$Input33 = GUICtrlCreateInput("", 1353, 637, 248, 21)
$Label57 = GUICtrlCreateLabel("Categoria", 1353, 667, 49, 17)
$Input34 = GUICtrlCreateInput("", 1353, 685, 248, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)

and this is a script   with your code

#include <FileConstants.au3>
#include <MsgBoxConstants.au3>
#include <WinAPIFiles.au3>
#include <File.au3>
#include <Array.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>


Opt("GUIOnEventMode", 1)

Global $Input1, $Input2, $Input3, $Input4

_Gui()

Func _Gui()
    $Form2 = GUICreate("Form2", 413, 226, 302, 218)
    $Group1 = GUICtrlCreateGroup("File da trattare", 0, 160, 412, 57)
    $Button1 = GUICtrlCreateButton("Apri", 303, 188, 75, 21)
    $Input2 = GUICtrlCreateInput("C:\Users\utente\Desktop\automatic_write_4_autoit\sorgente.txt", 23, 188, 249, 21)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Group2 = GUICtrlCreateGroup("Opzioni", 0, 84, 412, 77)
    $Checkbox1 = GUICtrlCreateCheckbox("Commento OFF", 245, 101, 97, 15)
    $Input1 = GUICtrlCreateInput("$GUI_Lang[", 13, 130, 153, 21)
    $Label1 = GUICtrlCreateLabel("Nomi ", 19, 112, 31, 17)
    $Checkbox2 = GUICtrlCreateCheckbox("Distructor OFF", 245, 118, 97, 15)
    $Checkbox3 = GUICtrlCreateCheckbox("Variabili OFF", 245, 136, 97, 15)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Button2 = GUICtrlCreateButton("Start", 327, 26, 75, 21)
    $Input3 = GUICtrlCreateInput("$SITIWEB_NIMLTY_eBay_", 8, 26, 305, 21)
    $Label2 = GUICtrlCreateLabel("Suffisso da sostituire", 24, 8, 100, 17)
    $Input4 = GUICtrlCreateInput("C:\_GESTIONALE_NEW\CONFIGURE\language\Gui\Italian.lang", 121, 63, 281, 21)
    $Label3 = GUICtrlCreateLabel("Percorso File lingua:", 16, 64, 99, 17)
    GUISetState(@SW_SHOW)


    GUISetOnEvent($GUI_EVENT_CLOSE, "_close")
    GUICtrlSetOnEvent($Button2, _start)

EndFunc   ;==>_Gui
#EndRegion ### END Koda GUI section ###

Func _start()
    FileDelete("C:\Users\utente\Desktop\automatic_write_4_autoit\File_lingua.txt")
    FileDelete("C:\Users\utente\Desktop\automatic_write_4_autoit\File_sorgente_new.txt")
    FileDelete("C:\Users\utente\Desktop\automatic_write_4_autoit\File_Destruct.txt")
    FileCopy("C:\_GESTIONALE_NEW\CONFIGURE\language\Gui\Italian.lang", "C:\Users\utente\Desktop\automatic_write_4_autoit\Italian.lang", 1)
    Local $sLSuffixLanguage = GUICtrlRead($Input1)
    Local $sLSuffix = GUICtrlRead($Input3)
    Local $aLTextElaborate = FileReadToArray(GUICtrlRead($Input2))
    ;_ArrayDisplay($aLTextElaborate,'47')
    For $i = 0 To UBound($aLTextElaborate) - 1
        Local $sLChar = StringLeft($aLTextElaborate[$i], 1)
        If $sLChar <> "$" Then
            $aLTextElaborate[$i] = ""
        EndIf
    Next
    $aLTextElaborate = _Remove_BlankIN_Array($aLTextElaborate)
    ;=============================================== SOSTITUZIONE $ VARIABILE RINOMINA ======================================
    ;_ArrayDisplay($aLTextElaborate)
    For $i = 0 To UBound($aLTextElaborate) - 1
        Local $sLOutput = StringRegExpReplace($aLTextElaborate[$i], '(?i)[\$]', $sLSuffix)
        ;MsgBox(0,'51',$sLOutput)
        Local $aLtesti = StringRegExp($sLOutput, '(?i)"(.*?)"', $STR_REGEXPARRAYGLOBALMATCH)
        ;_ArrayDisplay($aLtesti)
        ;====================================================================================================================
        ;=================================== COMMENTO ; ===================================================================
        If $aLtesti[0] <> "" Then
            _True_write_File("C:\Users\utente\Desktop\automatic_write_4_autoit\File_lingua.txt", $aLtesti[0])
            Local $sLFondoComment = StringRegExpReplace($sLOutput, '(?i)[\)]$', ') ; ' & $aLtesti[0])
        Else
            Local $sLFondoComment = StringRegExpReplace($sLOutput, '(?i)[\)]$', ')')
        EndIf
        ;======================================================================================================================
        ;==================================SUFFISSI ARRAY PER LINGUA =======================================================
        Local $iLControllo = 0
        Local $sLChar4lang = StringRight($sLFondoComment, 1)
        If $sLChar4lang <> ")" Then
            If $aLtesti[0] <> "" Then

                Local $aLLanguageALL = FileReadToArray("C:\Users\utente\Desktop\automatic_write_4_autoit\Italian.lang")
                ;_ArrayDisplay($aLLanguageALL, '85')
                ;Local $iCountLines = _FileCountLines(@ScriptFullPath)
                For $j = 0 To UBound($aLLanguageALL) - 1
                    If StringRegExp($aLLanguageALL[$j], "^" & $aLtesti[0] & "$") Then
                        ;  MsgBox($MB_SYSTEMMODAL, "Found it!", $aLtesti[0] & " is on line " & $j + 1)
                        Local $sLReady = StringRegExpReplace($sLFondoComment, '(?i)"(.*?)"', $sLSuffixLanguage & ($j + 1) & "]")
                        $iLControllo = 1
                    EndIf
                Next
                If $iLControllo = 0 Then
                    _True_write_File("C:\Users\utente\Desktop\automatic_write_4_autoit\Italian.lang", $aLtesti[0])
                    Local $iLTotLine = _FileCountLines("C:\Users\utente\Desktop\automatic_write_4_autoit\Italian.lang")
                    ;   MsgBox(0,'','ho scritto')
                    Local $sLReady = StringRegExpReplace($sLFondoComment, '(?i)"(.*?)"', $sLSuffixLanguage & $iLTotLine & "]")
                Else
                    $iLControllo = 0
                EndIf


            EndIf
            ;Local $sLReady = StringRegExpReplace($sLFondoComment, '(?i)"(.*?)"', $sLSuffixLanguage&"]")
        Else
            Local $sLReady = StringRegExpReplace($sLFondoComment, '(?i)"(.*?)"', '""')
        EndIf
        ;======================================================================================================================
        _True_write_File("C:\Users\utente\Desktop\automatic_write_4_autoit\File_sorgente_new.txt", $sLReady)

    Next
    MsgBox(0, 'Info', 'Fine processo 1')
    Local $aLNew_source = FileReadToArray("C:\Users\utente\Desktop\automatic_write_4_autoit\File_sorgente_new.txt")

    Local $aLClone[UBound($aLNew_source)]
    For $i = 0 To UBound($aLNew_source) - 1
        Local $aLtesti = StringRegExp($aLNew_source[$i], '(?i)(.*?) = ', $STR_REGEXPARRAYGLOBALMATCH)
        ;_ArrayDisplay($aLtesti)
        $aLClone[$i] = $aLtesti[0]
        _True_write_File("C:\Users\utente\Desktop\automatic_write_4_autoit\File_Destruct.txt", "GUICtrlDelete(" & $aLtesti[0] & ")")
    Next
    For $i = 0 To UBound($aLClone) - 1
        _True_write_File("C:\Users\utente\Desktop\automatic_write_4_autoit\File_Variabili.txt", $aLClone[$i])
    Next

    Global $array[6]
    Global $file_tot_gui = _FileCountLines("C:\Users\utente\Desktop\automatic_write_4_autoit\File_Variabili.txt")
    MsgBox(0, 'Info', $file_tot_gui)
    Global $b = 1
    Global $a = 1
    _5_a_riga()

    Local $aLLanguageORIG = FileReadToArray(GUICtrlRead($Input4))
    ;_ArrayDisplay($aLLanguageORIG, '105')
    $aLLanguageORIG = _Remove_BlankIN_Array($aLLanguageORIG)
    Local $aLnewLang = FileReadToArray("C:\Users\utente\Desktop\automatic_write_4_autoit\File_lingua.txt")
    #cs
        For $j=0 To UBound($aLLanguageORIG) -1
        For $i=0 To UBound($aLnewLang)-1
        If $aLLanguageORIG[$j] <>
        Next
        Next
    #ce
    Local $found
    For $i = 0 To UBound($aLLanguageORIG) - 1
        $found = _ArraySearch($aLnewLang, $aLLanguageORIG[$i])
        ;MsgBox(0,'',$found)
        If $found <> "-1" Then
            ; ConsoleWrite("Array1[" & $i & "] = Array2[" & $found & "] : " & $aLLanguageORIG[$i] & "=" & $aLnewLang[$found] & @LF)
        Else
            ConsoleWrite($aLLanguageORIG[$i] & @LF)
        EndIf
    Next
EndFunc   ;==>_start

Func _5_a_riga()

    Local $hFileOpen = FileOpen("C:\Users\utente\Desktop\automatic_write_4_autoit\File_Variabili.txt", $FO_READ)
    Do


        Local $sFileRead = FileReadLine($hFileOpen, $a)

        $array[$b] = $sFileRead

        If Mod($b, 5) = 0 Then
            FileWrite("C:\Users\utente\Desktop\automatic_write_4_autoit\File_Variabili.txt", "Global " & $array[1] & "," & $array[2] & "," & $array[3] & "," & $array[4] & "," & $array[5] & @CRLF)
            $b = 0
        EndIf


        $b += 1
        $a += 1

    Until $a = ($file_tot_gui + 1)


EndFunc   ;==>_5_a_riga
; #INDEX# ========================================================================
; Title .........: GUI_Configure.au3
; AutoIt Version : 3.3.14.2++
; Language ......: Italian
; Description ...: A collection of Function for Logic of Gest
; Author ........: Faustf
; What do you do.: Remove Blank in array 1d
; Version .......: 0.0.1 BETA - Work in progress 15/03/2016
; Syntax ........:
; ================================================================================

Func _Remove_BlankIN_Array($arr_2)

    For $i = UBound($arr_2) - 1 To 0 Step -1
        If $arr_2[$i] = "" Then
            _ArrayDelete($arr_2, $i)
        EndIf
    Next
    Return $arr_2
EndFunc   ;==>_Remove_BlankIN_Array
; #INDEX# ========================================================================
; Title .........: GUI_Configure.au3
; AutoIt Version : 3.3.14.2++
; Language ......: Italian
; Description ...: A collection of Function for Logic of Gest
; Author ........: Faustf
; What do you do.: Write data in File
; Version .......: 0.0.1 BETA - Work in progress 15/03/2016
; Syntax ........:
; ================================================================================

Func _True_write_File($sFilePath, $sDataWrite, $iReturn = 0)
    If $iReturn = Default Then $iReturn = 0

    $file = FileOpen($sFilePath, 1)
    If $iReturn = 0 Then
        FileWrite($file, $sDataWrite & @CRLF)
    Else
        FileWrite($file, $sDataWrite)
    EndIf
    FileClose($file)

EndFunc   ;==>_True_write_File
While 1
    Sleep(100)
WEnd
Func _close()
    Exit
EndFunc   ;==>_close

when arrive at  char  ?  it not find first time , and is correct but continue to unfind also after , and at end  of file i have  many ?

o_O

Link to comment
Share on other sites

  • Moderators

faustf,

I did not realise that the "?" was a required search string. That character is a valid PCRE token (meaning that something might not exist) thus we need to escape the search string so that the RegEx realises that all characters are literal. Using the file you posted this finds the "?" without problem:

#include <MsgBoxConstants.au3>

; Read file into array
$aLines = FileReadToArray("faustf.txt")

; Set required string to find
$sTarget = "?"

; Now look for the string in the file and return the line number
For $i = 0 To UBound($aLines) - 1
    ; Now look for a line which matches the target
    ; - using the ^ $ anchors means that the other lines containing the string do NOT match
    ; - Using \Q...\E forcesall characters int eh sting to be interpreted literally
    If StringRegExp($aLines[$i], "^\Q" & $sTarget & "\E$") Then
        ; And we need to add 1 to the index to get the line number
        MsgBox($MB_SYSTEMMODAL, "Found it!", $sTarget & " is on line " & $i + 1)
    EndIf
Next

M23

Edited by Melba23
Typo

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
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
 Share

  • Recently Browsing   0 members

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