SplitString
purozongo
when i try to execute the following
function pruebasplit()
string palabra=date()
string expr="([[:alpha:]]+), ([[:digit:]]+) ([[:alpha:]]+) ([[:alpha:]]+) ([[:alpha:]]+) ([[:digit:]]+)"
string dia, numero, mes, de, ano
splitstring/E=(expr) palabra, dia, numero, de, mes, de, ano
print dia
print numero
print mes
print ano
//print palabra
end
i have no answer...(in the command window nothing is printed), but when i do de following...
function pruebasplit()
string palabra="Mie, 07 de May de 2008"
string expr="([[:alpha:]]+), ([[:digit:]]+) ([[:alpha:]]+) ([[:alpha:]]+) ([[:alpha:]]+) ([[:digit:]]+)"
string dia, numero, mes, de, ano
splitstring/E=(expr) palabra, dia, numero, de, mes, de, ano
print dia
print numero
print mes
print ano
//print palabra
end
i have ...
Mie
07
May
2008
what is the problem???
May 7, 2008 at 06:33 am - Permalink
string palabra=Secs2Date(DateTime,1)
it print
rcoles
07
Mayo
2008
any idea?
May 7, 2008 at 06:47 am - Permalink
What is the result when you type ... print date() ... in your command window? The format of the function date() is system dependent, whereas that for Secs2Date(...) is likely not.
--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAH
May 7, 2008 at 12:15 pm - Permalink
print date()
the result is
Jue, 08 de May de 2008
and... when i execute the original function (whit date()) the result was:
Jue
08
May
2008. (for today)
but the problem was whit.
Mié, 07 de May de 2008
this because my OS is in Spanish, but the idea is that the program can by executed independently the OS lenguage.
May 8, 2008 at 04:31 pm - Permalink
If you need this to return the same values regardless of the localized version of the OS or the time/date settings in place on a particular user's computer, I'd recommend using the Secs2Date function and pass -1 as the value of the format parameter. That way you always know the format that will be returned, and you can do what you wish with it.
The one problem I can think of with doing this is that if you need to actually print the name of the day and/or name of the month, I'm not sure how you could write code that would work the same regardless of the OS or date settings. If you know that you only need to support a small and finite number of different languages, you could just use a lookup table that you define in your code. But I don't know how you could reliably support any language.
May 9, 2008 at 05:47 am - Permalink
the aim of the sequence is to create a string to name a folder for store my aquired waves.
i actually do some changes, but the final result is some like this:
string fecha=Secs2Date(DateTime,1)
string expr="([[:alpha:]]+), ([[:digit:]]+) ([[:alpha:]]+) ([[:alpha:]]+) ([[:alpha:]]+) ([[:digit:]]+)"
string dia, numero, mes, de, ano
splitstring/E=(expr) fecha, dia, numero, de, mes, de, ano
string foldername=numero+mes+ano
print foldername
end
thanks for the advices.
this print (for today) 14May2008, and this is independ of the OS lenguage.
And for the Folder name just add,
NewDataFolder $foldername
----
German Fernandez.
Physiology Lab.
Faculty of Science.
University of Chile.
May 14, 2008 at 09:25 am - Permalink