davzell13 Posted October 23, 2015 Share Posted October 23, 2015 Hello, excuse my bad english i'm french.i have a list with my client number and an ID associate to this client.N° client ID NUMER000575 65657cf30c8gdsgfdgfd88b4588 NUMER000576 65657d14dsgfsgfsgssdfdsf4595 NUMER004218 6565af2b948b09afe58b45e6dsf NUMER270575 6565bdcd94fef998228b456bffat the start, my script recover the number of my client in an other file.Example i want find the 575 in my column "N° client" and copy the ID in front of.But the 575 is also in the 270575 (last line) Is it possible ? Second question, my list is on a txt file or in a XLS file Is it possible to read in the XLS file without Excel installated ? thanks. Link to comment Share on other sites More sharing options...
mikell Posted October 23, 2015 Share Posted October 23, 2015 (edited) $txt = FileRead("1.txt") $n = "575" $id = StringRegExpReplace($txt, '(?s).*\s*NUMER0*' & $n & '\s*(\w+).*', "$1") If @extended Then Msgbox(0,"", $id)You can read your file if in txt format using FileReadToArrayBTW please avoid double posts (both French and English forums) Edited October 23, 2015 by mikell Link to comment Share on other sites More sharing options...
davzell13 Posted October 23, 2015 Author Share Posted October 23, 2015 $txt = FileRead("1.txt") $n = "575" $id = StringRegExpReplace($txt, '(?s).*\s*NUMER0*' & $n & '\s*(\w+).*', "$1") If @extended Then Msgbox(0,"", $id)You can read your file if in txt format using FileReadToArrayBTW please avoid double posts (both French and English forums) thanks, but when i try the script it doesn't work.What is the use of "@extended ? Link to comment Share on other sites More sharing options...
davzell13 Posted October 23, 2015 Author Share Posted October 23, 2015 erratum, it's ok, i have forget the 0 after NUMER but if i search the number 270575 it dosn't work because of the NUMER0 i'm going to try to adapted this script Link to comment Share on other sites More sharing options...
mikell Posted October 23, 2015 Share Posted October 23, 2015 In your text from post #1 I saw thisNUMER270575 6565bdcd94fef998228b456bffSo I assumed that the 'N°client' was composed of NUMER + 6 digitsIf it should be NUMERO + digits you just have to insert the 'O' (letter) after NUMER in the expression Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now