matlab - How to textscan with multiple delimiters -


i trying read in file contains thousands of lines of format:

aaaaaaaa    2013.99.2314.029    0    off    n 

which tab delimited file. last column don't care. 2 columns before variable, read them strings. main problem second column. number divided several parts

2013.99.2314.029 

is year 2013, day 99, second 2314.029.

i want use textscan read in whole file @ once, somehow split complicated date string read in.

currently have scan string:

scan_str = '%s\t%f.%f\t%s\t%s\t%*s' 

which reads date string 2 floats. i'd read 2 ints , float. using

scan_str = '%s\t%d.%d.%f\t%s\t%s\t%*s' 

truncates 2013 , 2314 , messes rest of line. tried escaping '.' '.' pops error.

any suggestions? i'd it's scanned in due large size of file. memory runs low when start trying change types of large data sets.

edit:

really need scan string 2013.99.2314.029 return 2 integers , float.

'%d.%d.%f' 

doesn't work. nor using delimiter '.'. tried %u well. rounds decimal reads them in.

le sigh.

i tried matlab 2012b , seems work on end.

scan_str = '%s\t%4d.%d.%f\t%d\t%s%*[^\n]' 

Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -