example line 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 11 1220.344590 0.728E-23 0.681E+01 2612.7991 0.0425-9.981E+00 8.210E-01 1.002E+01 8.185E-01 0.00109-2.109E-01 1.068E+00 2.119E-01 1.072E+000.231 0 1 0 0 0 0 11 6 5 12 7 6 5766643033 1 1 1 1 69.0 75.0 mol,iso,ν, S, A, E", γ(N2), c1, n1, c2, n2, δ(N2) d1, q1, d2, q2, γ(self), Vupper, Vlower, Rotupper, Rotlower, Ier(6), IRef(6), g_up, g_low parameter units FORTRAN C++/python ---------------------------------------------------------------------------------------------- molecule id (mol) NA I2 %d2 isotopologue id (iso) NA I1 %d2 line position ν cm^-1 F12.6 %f12.6 line intensity S (cm^-1)/(molecule cm^-2) E10.3 %10.3e Einstein A s^-1 E10.3 %10.3e lower state energy (term value) E" cm^-1 F10.4 %10.4f N2-broadened half-width γ(N2) cm^-1 atm^-1 F7.4 %7.4f temperature dependence coefficients for γ(N2): c1, c2 cm^-1 atm^-1 ES10.3E2 %10.3e for γ(N2): n1, n2 unitless ES10.3E2 %10.3e N2-pressure induced line shift δ(N2) cm^-1 atm^-1 F8.5 %8.5f temperature dependence coefficients for δ(N2): d1, d2 cm^-1 atm^-1 ES10.3E2 %10.3e for δ(N2): q1, q2 unitless ES10.3E2 %10.3e self-broadened half-width γ(self) cm^-1 atm^-1 F5.3 %5.3f upper state vibrational quantum numbers NA A15 %15s lower state vibrational quantum numbers NA A15 %15s upper state rotational quantum numbers J', Ka', Kc' NA A15 %15s lower state rotational quantum numbers J", Ka", Kc" NA A15 %15s error codes for ν, S, γ(N2), γself, n(N2),δ(N2) NA 6I1 6%d1 reference codes for ν; S; γ(N2), γself ; n(N2) ; δ(N2) NA 6I2 6%d2 The upper and lower state statistical weights unitless F7.1 %7.1f ---------------------------------------------------------------------------------------------- FORTRAN code to read the file c************************************************************************************************************** program read_txt implicit double precision(a-h,o-z) parameter (eof = -1) logical read_more_data real*4 n1,n2 character*15 Qvib_up,Qvib_lo,Qrot_up,Qrot_lo open(1,file='H2O-N2_2019.txt',status='old') 900 FORMAT(I2,I1,F12.6,2ES10.3E2,F10.4,F7.4,4ES10.3E2,F8.5,4ES10.3E2,F5.3,4A15,6I1,6I2,1x,2F7.1) nr = 0 read_more_data=.TRUE. dowhile(read_more_data) read(1,900) mol,iso,freq,S,A,E_lower,g_N2,c1,n1,c2,n2,shift,d1,q1,d2,q2,gself, + Qvib_up,Qvib_lo,Qrot_up,Qrot_lo,Ie_F,Ie_S,Ie_gN2,Ie_gself,Ie_nN2,Ie_dN2, + IRef_F,IRef_S,IRef_g_N2,IRef_gself,IRef_n,IRef_shift_N2,gj_up,gj_lo if(ios.eq.eof)then write(*,*) ' Data input finished' read_more_data=.FALSE. else nr = nr + 1 ! do your thing here endif enddo end c************************************************************************************************************** python code to read the file #------------------------------------------------- import decimal import numpy as np infile = 'H2O-N2_2019.txt' H2ON2 = open(infile) nt = 0 for line in H2ON2: nt = nt + 1 line = line.rstrip() mol = line[0:2] iso = line[2:3] freq = float(line[3:15]) S = float(line[15:25]) A = float(line[25:35]) E_lower = float(line[35:45]) g_N2 = float(line[45:52]) c1 = float(line[52:62]) n1 = float(line[62:72]) c2 = float(line[72:82]) n2 = float(line[82:92]) shift = float(line[92:100]) d1 = float(line[100:110]) q1 = float(line[110:120]) d2 = float(line[120:130]) q2 = float(line[130:140]) gself = float(line[140:145]) V_upper = line[145:160] V_lower = line[160:175] Qrot_up = line[175:190] Qrot_lo = line[190:205] Ie_F = line[205:206] Ie_S = line[206:207] Ie_gN2 = line[207:208] Ie_gself = line[208:209] Ie_nN2 = line[209:210] Ie_dN2 = line[210:211] IRef_F = line[211:213] IRef_S = line[213:215] IRef_g_N2 = line[215:217] IRef_gself =line[217:219] IRef_n = line[219:221] IRef_shift_N2 = line[221:223] gj_up = float(line[224:231]) gj_lo = float(line[231:238]) # do your thing here #-------------------------------------------------