Jun-21-2019, 09:43 AM
What I've done, up to now, is successful only for the first group of short.txt database, while my goal is to have some drifts on adjusting iteratively the line
Thx in advance
short.txt
tle= data[0]+'\n'+data[1]+'\n'+data[2]+'\n'
in order to complete the whole file scanning.Thx in advance
1 2 3 4 5 6 7 8 9 10 11 |
# --- line6.py ------ with open ( "short.txt" , "r" ) as myfile: data = myfile.read().splitlines() tle = data[ 0 ] + '\n' + data[ 1 ] + '\n' + data[ 2 ] + '\n' print (tle) #------ OUTPUT ---------- ''' FALCON 9 DEB 1 44298U 19029BR 19167.86418532 .00001313 00000-0 38063-4 0 9991 2 44298 53.0043 62.2948 0004912 13.4119 346.7015 15.43512957 4901 ''' |
Output:FALCON 9 DEB
1 44298U 19029BR 19167.86418532 .00001313 00000-0 38063-4 0 9991
2 44298 53.0043 62.2948 0004912 13.4119 346.7015 15.43512957 4901
STARLINK AB
1 44260U 19029AB 19157.99245370 .01269439 00000-0 29305-1 0 9993
2 44260 53.0001 109.7412 0006821 81.1213 255.2409 15.39387046 2245
STARLINK E
1 44239U 19029E 19167.13356954 -.00013522 00000-0 -91175-3 0 9994
2 44239 53.0083 69.0416 0002637 113.5217 246.6049 15.05529924 3542
STARLINK P
1 44248U 19029P 19167.86126092 -.00617922 00000-0 -42907-1 0 9993
2 44248 52.9974 64.8224 0004816 42.9633 317.1731 15.07410453 3682
STARLINK D
1 44238U 19029D 19167.85872376 -.00444761 00000-0 -30673-1 0 9990
2 44238 52.9982 64.8538 0002160 82.0309 278.0925 15.07669053 2123
STARLINK H
1 44242U 19029H 19167.72360443 -.01130229 00000-0 -86918-1 0 9993
2 44242 52.9937 65.5606 0008561 56.4128 303.7676 15.04350216 3717