I would like to import data from text file to excel as below.(File attached) I want only specific column data from text file to be imported in excel. In the attached text file, Row 7 has the key word. and from the proceding rows, data from column 77- 81 for P1,P2,...onwards to be inserted in new column in excel.(P1 2,4 ..)Please note that from P6 to P7, no data availble (No "P")and it should be omited. It should work till key word on row 25 (2222).(this row number will get changed as I cut alot of data). Then in next column of excel, values starting after 22222,value for each P1, P2...,value on Column 57-61 to be inserted.(Like P1 2,40..). This should go under 33333. Then in next column Value starting from 333333 and value in column 17-21 should be copied as before. After first 6 columns (one for each px and its corresponding value), next 6 should be for the below data. It should repeat untill end of data. Please note that P and P' also exist. Thank you so much if anyone can help with this. Requested output is in the table. INput is 1 3 1 -1
17 3 1 0 0 1
(8X,2A4,34X,3F10.0)
1
0 2 0 0 2 5
P 43 P 38 P'38
11111
1P 1 10 1.6022.0028.00 8.00 8.00 NPP1 0.00 1 1 0.0020.00 4.00 1.0037.00 2.40
1P 2 10 1.6022.0028.00 8.00 8.00 NPP2 0.00 1 1 0.0020.00 4.00 1.00 0.00 0.00
2P 3 10 1.6022.0028.00 8.00 8.00 NPP2 0.00 1 1 0.0020.00 4.00 1.00 0.00 0.00
1P 5 10 1.8022.0028.00 8.00 0.00 NPP2 0.00 1 1 0.0020.00 4.00 1.00 0.00 0.00
1P 6 21 0.00 0.00 0.00 0.00 0.00 QS4 0.00 1 1 0.0020.00 4.00 1.0066.00 5.20
4
0.0000 0.8000 0.0000
21.2000 0.8000 1.6000
21.2000 24.4000 1.6000
24.4000 24.4000 6.8000
1P 7 10 1.6022.0028.00 8.00 8.00 NPP2 0.00 1 1 0.0020.00 4.00 1.00 0.00 0.00
1P 8 10 1.6022.0028.00 8.00 8.00 NPP2 0.00 1 1 0.0020.00 4.00 1.00 0.00 0.00
1P 9 10 1.6022.0028.00 8.00 8.00 NPP2 0.00 1 1 0.0020.00 4.00 1.0023.00 3.20
1P 10 10 1.6024.0028.00 8.00 8.00 NPP2 0.00 1 1 0.0020.00 4.00 1.00 0.00 0.00
-1
85 P 1 1 1.0
-1
22222
1 P 1 1.40122.0 NPP2 1 122.00 4.80 1.2030.00 2.40
1 P 2 1.40122.0 NPP2 1 122.00 4.80 1.2030.00 2.40
1 P 3 1.40122.0 NPP2 1 122.00 4.80 1.2030.00 2.40
1 P 4 1.40122.0 NPP2 1 122.00 4.80 1.2030.00 2.40
1 P 5 1.40154.0 NPP2 1 122.00 4.80 1.20 0.00 0.00
1 P 6 1.40176.0 NPP2 1 122.00 4.80 1.20 0.00 0.00
1 P 7 1.40176.0 NPP2 1 122.00 4.80 1.20 0.00 0.00
1 P 8 1.40176.0 NPP2 1 122.00 4.80 1.20 0.00 0.00
1 P 9 1.40176.0 NPP2 1 122.00 4.80 1.20 0.00 0.00
1 P 10 1.40176.0 NPP2 1 122.00 4.80 1.20 0.00 0.00
-1
33333
1 P 1 4 1.90 0.00 0.00 0.00 NPP2
1 P 2 4 1.90 0.00 0.00 0.00 NPP2
1 P 3 4 1.90 0.00 0.00 0.00 NPP2
1 P 4 4 1.90 0.00 0.00 0.00 NPP2
1 P 5 4 2.40 0.00 0.00 0.00 NPP2
1 P 6 4 2.80 0.00 0.00 0.00 NPP2
1 P 7 4 2.80 0.00 0.00 0.00 NPP2
1 P 8 4 2.80 0.00 0.00 0.00 NPP2
1 P 9 4 3.10 0.00 0.00 0.00 NPP2
1 P 10 4 3.20 0.00 0.00 0.00 NPP2
-1
44444
55555
2 Y48 Y49 85 0 0 0 -1
0 2 0 0 0 5
P 43 P 38 P'38
11111
1P 1 10 1.6022.0028.00 8.00 8.00 NPP1 0.00 1 1 0.0020.00 4.00 1.0037.00 2.40
1P 2 10 1.6022.0028.00 8.00 8.00 NPP2 0.00 1 1 0.0020.00 4.00 1.00 0.00 0.00
1P 3 10 1.6022.0028.00 8.00 8.00 NPP2 0.00 1 1 0.0020.00 4.00 1.00 0.00 0.00
1P 4 10 1.6022.0028.00 8.00 8.00 NPP2 0.00 1 1 0.0020.00 4.00 1.00 0.00 0.00
1P 5 10 1.8022.0028.00 8.00 0.00 NPP2 0.00 1 1 0.0020.00 4.00 1.00 0.00 0.00
1P 6 21 0.00 0.00 0.00 0.00 0.00 QS4 0.00 1 1 0.0020.00 4.00 1.0066.00 3.20
4
0.0000 0.8000 0.0000
21.2000 0.8000 1.6000
21.2000 24.4000 1.6000
24.4000 24.4000 6.8000
1P 7 10 1.6022.0028.00 8.00 8.00 NPP2 0.00 1 1 0.0020.00 4.00 1.00 0.00 0.00
1P 8 10 1.6022.0028.00 8.00 8.00 NPP2 0.00 1 1 0.0020.00 4.00 1.00 0.00 0.00
1P 9 10 1.6022.0028.00 8.00 8.00 NPP2 0.00 1 1 0.0020.00 4.00 1.00 0.00 0.00
1P 10 10 1.6024.0028.00 8.00 8.00 NPP2 0.00 1 1 0.0020.00 4.00 1.00 0.00 0.00
-1
22222
1 P 1 1.40122.0 NPP2 1 122.00 4.80 1.2030.00 2.40
1 P 2 1.40122.0 NPP2 1 122.00 4.80 1.2030.00 2.40
1 P 3 1.40122.0 NPP2 1 122.00 4.80 1.2030.00 2.40
1 P 4 1.40122.0 NPP2 1 122.00 4.80 1.2030.00 2.40
1 P 5 1.40154.0 NPP2 1 122.00 4.80 1.20 0.00 0.00
1 P 6 1.40176.0 NPP2 1 122.00 4.80 1.20 0.00 0.00
1 P 7 1.40176.0 NPP2 1 122.00 4.80 1.20 0.00 0.00
1 P 8 1.40176.0 NPP2 1 122.00 4.80 1.20 0.00 0.00
1 P 9 1.40176.0 NPP2 1 122.00 4.80 1.20 0.00 0.00
1 P 10 1.40176.0 NPP2 1 122.00 4.80 1.20 0.00 0.00
-1
33333
1 P 1 4 1.90 0.00 0.00 0.00 NPP2
1 P 2 4 1.90 0.00 0.00 0.00 NPP2
1 P 3 4 1.90 0.00 0.00 0.00 NPP2
1 P 4 4 1.90 0.00 0.00 0.00 NPP2
1 P 5 4 2.40 0.00 0.00 0.00 NPP2
1 P 6 4 2.80 0.00 0.00 0.00 NPP2
1 P 7 4 2.80 0.00 0.00 0.00 NPP2
1 P 8 4 2.80 0.00 0.00 0.00 NPP2
1 P 9 4 3.10 0.00 0.00 0.00 NPP2
1 P 10 4 3.20 0.00 0.00 0.00 NPP2
-1
44444
55555
P1 2.40 P1 2.40 P1 1.90 P1 X P1 X P1 X
P2 0.0 P2 2.40 P2 1.90 P2 X P2 X P2 X
P3 X P3 X P3 X P3 X P3 X P3 X