Im searching for a string in a text file and printing it out. The output I get is all in one line and I don't know how to separate it so that it is on multiple lines.
My text file contains the following
Number Date Time08-D-123519 02-Apr-2016 21:58:5405-WD-3052 02-Apr-2016 22:03:35008-D-123519 02-Apr-2016 21:58:5405-WD-3052 02-Apr-2016 22:06:38005-WD-3052 02-Apr-2016 22:18:56008-D-123519 02-Apr-2016 21:58:5405-WD-3052 02-Apr-2016 22:29:10008-D-123519 02-Apr-2016 21:58:54
and I am and searching for the number and printing it out like so
tScan = textscan(fileID, '%s','Delimiter','');tScan = tScan{:};licenseP = ~cellfun(@isempty, strfind(tScan,'05-WD-3052'))output = [tScan{licenseP}]
What I get
05-WD-3052 02-Apr-2016 22:03:35005-WD-3052 02-Apr-2016 22:06:38005-WD-3052 02-Apr-2016 22:18:56005-WD-3052 02-Apr-2016 22:29:100
What I'm trying to get
05-WD-3052 02-Apr-2016 22:03:35005-WD-3052 02-Apr-2016 22:06:38005-WD-3052 02-Apr-2016 22:18:56005-WD-3052 02-Apr-2016 22:29:100
Best Answer