AboutScottGem Expertise I have been an IT professional for over 16 years. During that time I have accumulated a large store of knowledge and experience. This allows me to assist with a large variety of technology issues. My specialty is Database design primarily with MS Access. However, I can answer questions on many different IT related topics.
Experience I have worked in IT support for over 16 years. I have also helped people in cyberspace for a good portion of that time. I have been a volunteer staffer on Prodigy and AOL. I was the #2 ranked expert at AskMe.com (#1 in Technology) and am currently ranked at or near the top at Answerway.com and PointAsk.com.
Expert: ScottGem Date: 11/27/2007 Subject: easiest way to parse instrument data
Question Can you please point me in the right direction for importing the following data into MS Access? Thank you for your help.
The data is from a geophysical instrument(induced polarization) used to image the subsurface . Each reading from the instrument starts with a number (#1187) and is followed by regular expressions and the data itself. The ideal database column headers would be:
# 1187 data from dipole 1 ( Dipole - Dipole array )
mode 1 pulse = 2 s pulses number = 16
XC (ft)= 600.0 XP (ft)= 1200.0 D (ft)= 600.0 Line = 2.0
Ro=323.8 ohm.m
Vp = 278.94 mV Qv= 1% Ps= 61 mV In = 2970.0 mA
M = 2.0 Em = 0.0
M1 = 3.9 M2 = 3.0 M3 = 2.5 M4 = 2.1 M5 = 1.8
M6 = 1.6 M7 = 1.4 M8 = 1.3 M9 = 1.2 M10= 1.1
control 1 - 2 Rs = 21.2 Kohm triggering dipole: 1
# 1188 data from dipole 2 ( Dipole - Dipole array )
mode 1 pulse = 2 s pulses number = 16
XC (ft)= 600.0 XP (ft)= 1800.0 D (ft)= 600.0 Line = 2.0
Ro=302.5 ohm.m
Vp = 65.155 mV Qv= 1% Ps= -51 mV In = 2970.0 mA
M = 2.9 Em = 0.1
M1 = 5.4 M2 = 4.2 M3 = 3.6 M4 = 3.1 M5 = 2.7
M6 = 2.5 M7 = 2.3 M8 = 1.9 M9 = 1.7 M10= 1.6
control 3 - 2 Rs = 26.2 Kohm triggering dipole: 1
# 1189 data from dipole 3 ( Dipole - Dipole array )
mode 1 pulse = 2 s pulses number = 16
XC (ft)= 600.0 XP (ft)= 2400.0 D (ft)= 600.0 Line = 2.0
Ro=213.2 ohm.m
Vp = 18.366 mV Qv= 1% Ps= 85 mV In = 2970.0 mA
M = 3.3 Em = 0.4
M1 = 6.3 M2 = 4.7 M3 = 4.3 M4 = 3.6 M5 = 3.3
M6 = 2.6 M7 = 2.4 M8 = 2.3 M9 = 2.1 M10= 1.7
control 4 - 2 Rs = 26.6 Kohm triggering dipole: 1
Answer There is actually no easy way to do this. You would need to use the OPEN command to open the text file and use Line Input to read each line in. From there you will have use the Left, Right, Mid and Instr functions to parse the data into variables that can then be written to a table.
Hope this helps,
Scott<>
Microsoft Access MVP 2007