01-05-2023
vince_est
Calcite | Level 5
Member since
06-15-2019
- 3 Posts
- 1 Likes Given
- 0 Solutions
- 0 Likes Received
-
Latest posts by vince_est
Subject Views Posted 1138 01-10-2020 06:45 AM 1141 01-10-2020 06:35 AM 1173 01-10-2020 05:06 AM -
Activity Feed for vince_est
- Liked Re: Extract numeric caracters and alphanumeric one from strings without delimiter for Ksharp. 01-13-2020 06:29 AM
- Posted Re: Extract numeric caracters and alphanumeric one from strings without delimiter on SAS Programming. 01-10-2020 06:45 AM
- Posted Re: Extract numeric caracters and alphanumeric one from strings without delimiter on SAS Programming. 01-10-2020 06:35 AM
- Posted Extract numeric caracters and alphanumeric one from strings without delimiter on SAS Programming. 01-10-2020 05:06 AM
-
Posts I Liked
Subject Likes Author Latest Post 6
01-10-2020
06:45 AM
I couldn't wait so I tried Andreas_ids solution and it works very well! I have to lear how to use regular expressions, it seems very powerful. Thank you so much for your help!
... View more
01-10-2020
06:35 AM
Thank you so much for your answers. I'll try them. I continued to search over internet after I posted my message and I've found a piece of code I adapted to my need: /* words to match delimited by "|" */ %let words = MODIFIE|MODIFIEV2|MODIFV2|MODIF|V2|test|new|rectifie|MODIFIE_KOMP|MODIFIE_KOMPV2|MODIFIE_KOMPv2|modifie|MODIF2|sansmauvaisedate|MODIFIEtestianpourjcc|v3|GA|GE|MODIFIEE; data example_clean; set testtri2; if _n_ = 1 then do; retain regex; drop regex; regex = prxparse("s/(&words)\s+//"); end; string = prxchange(regex, 1, want2); run; I have to manually enter the words I want to delete at the end of the filename but I works. I 'll try your solutions after lunch and I'll tell you the results
... View more
01-10-2020
05:06 AM
Hi, I need filter my datas from name of files which are copied in the system. These files are sometimes renamed and somtimes not. These files are named like that "201905061636XXXXXXXX65562.xls" but the length of the name is not always the same. In the beginning of the name, there is the date and the hour when the file was loaded so the length is always the same. XXXXX is the name of the client and the length changes. Then there are numbers at the end of the file and, sometimes, when the file have been manually modified, there letter like "Modify" or "test" or "testV2", "modifyV2" etc... after this last numeric string... I would like to cut these strings to identify the date and time in a single variable then the name of the client and the the last number writen in the name file. I dont want words like "Modify" or "Test" at the end. I can't find how to do that. I guess I can use Scan function or something like that but I have no idea how to use a sas function with that kind of variable. Of course I get the date and time with: date=substr(name,1,12) as the length is always the same but I don't know what to do with the other parts I need. thanks
... View more