craigkennedy
Programmer
Hi everyone.
I'm having an issue reading a file. It's basically a text file with a header whose length can change depending on the data input, followed by three columns of numbers which is the data I am interested in. I can open the file alright, but how do I read the file in such a way that I can ignore the header and just access the numeric data?
The file looks like this when opened...
Filename:
C:\Data\2010\290310\earth-moffat-firepla_100329100944.raw
File Created:
March 29, 2010 - 10:09 AM
Specimen Id:
earth sample moffat fireplace
Specimen Name:
earth sample moffat fireplace
Specimen Description:
Comment:
Scan Type: 2Theta Scan
Start Angle: 5 deg.
Stop Angle: 70 deg.
Num Points: 3251
Step Size: 0.02 deg.
Scan Rate: 1.000000
Scan Mode: Continuous
Wavelength: 1.540562
\Kalpha1: 1.540562 \Kalpha2: 1.544390 \Kbeta: 1.392218
Optics:
Detector:
Type: Fixed Slits
Tube:
Type: Fixed Slits
Datas:
Pos [deg] Rate [CPS] ESD [-]
Range 1 ---> Iteration 1
5.000 210.00 15.875
5.020 221.67 16.310
5.040 210.00 15.875
5.060 224.17 16.401
5.080 195.83 15.330
5.100 220.00 16.248
...
...
69.940 29.17 5.916
69.960 25.00 5.477
69.980 30.00 6.000
70.000 28.33 5.831
Everything up to the words "Iteration 1" I would like to ignore, and then read the 3 columns in to three arrays.
Thanks!
I'm having an issue reading a file. It's basically a text file with a header whose length can change depending on the data input, followed by three columns of numbers which is the data I am interested in. I can open the file alright, but how do I read the file in such a way that I can ignore the header and just access the numeric data?
The file looks like this when opened...
Filename:
C:\Data\2010\290310\earth-moffat-firepla_100329100944.raw
File Created:
March 29, 2010 - 10:09 AM
Specimen Id:
earth sample moffat fireplace
Specimen Name:
earth sample moffat fireplace
Specimen Description:
Comment:
Scan Type: 2Theta Scan
Start Angle: 5 deg.
Stop Angle: 70 deg.
Num Points: 3251
Step Size: 0.02 deg.
Scan Rate: 1.000000
Scan Mode: Continuous
Wavelength: 1.540562
\Kalpha1: 1.540562 \Kalpha2: 1.544390 \Kbeta: 1.392218
Optics:
Detector:
Type: Fixed Slits
Tube:
Type: Fixed Slits
Datas:
Pos [deg] Rate [CPS] ESD [-]
Range 1 ---> Iteration 1
5.000 210.00 15.875
5.020 221.67 16.310
5.040 210.00 15.875
5.060 224.17 16.401
5.080 195.83 15.330
5.100 220.00 16.248
...
...
69.940 29.17 5.916
69.960 25.00 5.477
69.980 30.00 6.000
70.000 28.33 5.831
Everything up to the words "Iteration 1" I would like to ignore, and then read the 3 columns in to three arrays.
Thanks!