Substring, Munger, or... formula?<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />I’ve been wrestling with a database problem for a couple of days and I’m stumped. I wonder if any of you might be able to help? I’m dealing with several hundred tables that include records for wildlife sites For each record, there is a field that includes the site identifier appended to the path in my computer and a .tif suffix, like these examples:
E:\Work\OWI\LIDAR\Owl_Landscapes\p99\p99sliced\rnd_SI_PK_UR3.tif
E:\Work\OWI\LIDAR\Owl_Landscapes\p99\p99sliced\rnd_SI_PK_20100195.tif
[Site identifier in bold italics]
I need to create a new field in each table that holds only the site identifier, minus the path and .tif suffix. I’m somewhat familiar with substring and Munger formulas that I have used to extract parts of strings. But in this case, some site identifiers have mixed text/numeric characters and the string length is different among different records, so I can’t get these formulas to work. Can someone offer advice?
Dave
Re: Substring, Munger o ... formula?<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />Ciao,
Scopri le espressioni regolari perl - base SAS = prxparse, prxchange ecc. Dovrebbe essere in grado di farlo in modo semplice.
Per aggiungere, sembra che tu abbia un inizio fisso? Se è così allora anche il tranwrd (substr (string, fixed_start), ". Tif", "") dovrebbe funzionare.
Re: Substring, Munger o ... formula?<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />Ciao Dave,
Prova il Parola() funzione.
Word (-2,: Column 1, "_.")
Questa formula ti farà ottenere quello che vuoi. L'argomento "-2" dice che la funzione Word () dovrebbe trovare la penultima parola usando _ e. come delimitatori.
-Jeff
Re: Substring, Munger o ... formula?<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />Non penso che le funzioni SAS standard funzionino in JMP.
La sottostringa è ciò che stai cercando.
Il punto di partenza è fisso, trova la posizione del periodo e la sottostringa tra quelli.