09-30-2015 07:50 PM
hi friends please help,
have one text file like this (test.text); (its tab delimited) (showing separate variables by bold and not bold) - trying to import it but not getting desire result, specially want to separate out red color and blue color as separate variable
zone mkt /sas/log1/02_mkt/logs 01-01_this_is_the_xyz_mkt_2015.09.30_04.01.37.log (ok) 0.104072 Sat Sep 19 04:04:51 2015
zone fin /sas/log1/02_fin/logs 05-05_this_is_the_xyz_fin_2015.09.30_04.05.00.log (ok) 0.104072 Sat Sep 19 04:21:51 2015
zone sales /sas/log1/02_sales/logs 10-13_this_is_the_xyz_sales_2015.09.30_04.22.13.log (ok) 0.104072 Sat Sep 19 04:54:09 2015
want (example for dataline 1 and it should be same for others too)
09-30-2015 08:20 PM
Your example does NOT look like it it tab delimited. it looks more like the values are space delimited.
But outside of the delimiters (if any) in the file it looks like you are trying to parse the filename into pieces.
10-01-2015 09:41 PM
Depending on how consistent the data is you could either parse it into more pieces and build it back up.
Or it might be easier to parse it just on the underscore and then use substr to remove the '.log' from the end.
Our you could look at using regular expressions.
10-02-2015 04:34 PM
so for example how can we get this done if we want to scan string from left to right?
10-02-2015 06:03 PM
If those dates always start with 2015, or even 20 ( or 20 and 19) you could use index function to find that location and then substr from 1 to that position -1 (the space before 2015).
This will be subtle Y2K type potential error but would likely not kick in until Jan 2100...