- Timestamp:
- Jul 16, 2018, 3:14:46 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/generic_tools.py
r1919 r1934 12710 12710 return narray 12711 12711 12712 def getting_fixedline(line, cuts, types ):12712 def getting_fixedline(line, cuts, types, dbg=False): 12713 12713 """ Function to get the values from a line of text with fixed lenght of different values 12714 12714 line: line with values … … 12720 12720 'S': string 12721 12721 'B': boolean 12722 dbg: debug mode (default False) 12722 12723 >>> Sline=' 87007 03012015 25.6 6.4 9.4 5 15' 12723 12724 >>> getting_fixedline(Sline, [8, 17, 23, 29, 36, 40, 45, 50], ['I', 'R', 'R', 'R', 'I', 'R', 'R', 'R']) … … 12746 12747 for ic in range(1,Ncuts): 12747 12748 val = line[cuts[ic-1]:cuts[ic]] 12749 if dbg: print ic, ':', val, '-->', types[ic] 12748 12750 if len(val.replace(' ','')) >= 1: 12749 12751 values.append(typemod(val, types[ic]))
Note: See TracChangeset
for help on using the changeset viewer.