MATLAB: How to get data from a .txt file

MATLABtxt

how to get data from a .txt file.I need numerical data only after 'Init seq' to perform calculations in matlab and create a .txt file with new data same as the source file.
------------------ Header -------------------------------------
TestDescription
DateTime 06.02.2013;11:50:17
SensorType COMBO1.5 SENSOR
FrameType OFFFRAME
CPOL 0
CPHA 0
Sensor 2
SensorRS485
SensorArmingPinX
SensorArmingPinY
SensorPullResistor
AD 1;2;3;4
Digital
SensorVcc 3.30 V
BurstRate 2000 Hz
MOSICount_Burst 20
SPIRate 40000 Hz
SCLK 8000000 Hz
ToolVersion
FPGAVersion SC 0.10
DeviceName USB <-> SPICE SN: 00009
ProjectFilename Project_Combo1.5.spi-cfg
CommandFilename Bosch_COMBO_1_5_SPI_Commands_and_Replies.h
CommandFileRevision 1.22
CRCTableFilename Bosch_COMBO_1_5_SPI_CRC_Table.c
CRCTableFileRevision 1.4
HW-State;Time[ms];MOSI[hex];MISO2[hex];MISO2-State;AIn1[mV];AIn2[mV];AIn3[mV];AIn4[mV];
------------------ Init Sequence ------------------------------
80;0.000;402B01E8;FFFFFFFF;00; 10;122;1993;1994;
80;0.025;802B00FB;FFFFFFFF;05; 11;123;1995;1996;
80;0.050;806000FE;FFFFFFFF;05; 11;122;1995;1996;
80;0.075;803E00E2;FFFFFFFF;05; 10;121;1993;1994;
80;0.100;803E00E2;FFFFFFFF;00; 11;124;1996;1998;
80;0.125;80500091;FFFFFFFF;00; 10;121;1993;1995;
80;0.150;80510078;FFFFFFFF;05; 10;122;1993;1995;
80;0.175;8052006C;FFFFFFFF;05; 12;123;1995;1997;
80;0.200;80530085;FFFFFFFF;05; 10;122;1993;1994;
80;0.225;80540044;FFFFFFFF;05; 12;123;1995;1997;
80;0.250;805500AD;FFFFFFFF;05; 10;122;1995;1996;
80;0.275;805600B9;FFFFFFFF;05; 10;121;1992;1993;
80;0.300;80570050;FFFFFFFF;05; 11;123;1996;1998;
80;0.325;80580014;FFFFFFFF;05; 10;122;1993;1995;
80;0.350;805900FD;FFFFFFFF;05; 10;122;1994;1995;
80;0.375;805A00E9;FFFFFFFF;05; 12;123;1996;1997;
80;0.400;40290115;FFFFFFFF;05; 10;121;1993;1994;
80;0.425;20000002;FFFFFFFF;05; 11;123;1996;1997;
80;0.450;600000F3;FFFFFFFF;05; 10;122;1995;1995;
80;0.475;A00000CF;FFFFFFFF;05; 10;122;1993;1994;
80;0.500;802F002E;FFFFFFFF;05; 11;123;1996;1998;
80;0.525;803100A6;FFFFFFFF;05; 10;122;1993;1995;
80;0.550;8033005B;FFFFFFFF;05; 11;123;1995;1996;
80;0.575;40290115;FFFFFFFF;05; 11;122;1995;1996;
80;0.600;20000002;FFFFFFFF;05; 10;122;1993;1993;
80;0.625;600000F3;FFFFFFFF;05; 11;123;1996;1998;
80;0.650;A00000CF;FFFFFFFF;05; 10;122;1993;1995;
80;0.675;802F002E;FFFFFFFF;05; 10;122;1993;1994;
80;0.700;803100A6;FFFFFFFF;05; 12;123;1996;1997;
80;0.725;8033005B;FFFFFFFF;05; 10;122;1993;1994;
80;0.750;40290115;FFFFFFFF;05; 10;123;1995;1997;
80;0.775;20000002;FFFFFFFF;05; 11;122;1994;1996;
80;0.800;600000F3;FFFFFFFF;05; 10;121;1992;1994;
80;0.825;A00000CF;FFFFFFFF;05; 12;124;1997;1998;
80;0.850;802F002E;FFFFFFFF;05; 10;122;1993;1995;
80;0.875;803100A6;FFFFFFFF;05; 10;122;1994;1995;

Best Answer

use textscan command and since you do not need the initail lines use the 'HeaderLines' option(in that you can specify how many lines u want to skip) use this: first open the file with fopen assume file identifier used is fid then, C=textscan(fid,'%d%f%s%s%d%d%d%d%d','Delimeter',';','HeaderLines','30');
Related Question