Hi guys i need some help to replace some line in text file using value from range i choose in my excel sheet.
for example i have test.txt and this text file is need to replace in some specific line that contain "#$ DISPLMNT" as starting point
the text will be like this
........................bla bla bla bla
#$ DISPLMNT (this is the starting point to search the line)
36.0000 (this will be the key to connect the excel)
0.000000 -5.80000 -8.43000 0.000000 0.000000 0.000000
6.80000 -5.80000 0.000000 0.000000 0.000000 0.000000
0.000000 -6.96000 -13.7200 0.000000 0.000000 0.000000
8.90000 -6.96000 0.000000 0.000000 0.000000 0.000000
0.000000 -6.58000 -21.0900 0.000000 0.000000 0.000000
12.8200 -6.19000 0.000000 0.000000 0.000000 0.000000
9999.99 9999.99 9999.99 9999.99 9999.99 9999.99
9999.99 9999.99 9999.99 9999.99 9999.99 9999.99
9999.99 9999.99 9999.99 9999.99 9999.99 9999.99
0.000000
............................bla bla bla ( there is so many numbers_)
#$ FORCMNT (this is the end point of search)
next i need to replace the line from "36.0000" until 0.000000
using the value from range i select in excel.
the excel file contains data like this
Q
1
2 X Y Z RX RY RZ
3 36.0000 (key for finding the text i want to replace)
4 0.00 -0.08 -0.78 0.00 0.00 0.00
5 0.51 -0.08 0.00 0.00 0.00 0.00
6 0.00 -0.10 -1.27 0.00 0.00 0.00
7 0.70 -0.10 0.00 0.00 0.00 0.00
8 0.00 -0.09 -1.95 0.00 0.00 0.00
9 1.01 -0.09 0.00 0.00 0.00 0.00
10 9999.99 9999.99 9999.99 9999.99 9999.99 9999.99
11 9999.99 9999.99 9999.99 9999.99 9999.99 9999.99
12 9999.99 9999.99 9999.99 9999.99 9999.99 9999.99
13 .......
14 ..........
15.................theres still more until Q700
i need to select the value from range "Q3:Q12" and then update or replace the text file using this value..
so the text file will be look like this after i replace it
36.0000
0.00 -0.08 -0.78 0.00 0.00 0.00
0.51 -0.08 0.00 0.00 0.00 0.00
0.00 -0.10 -1.27 0.00 0.00 0.00
0.70 -0.10 0.00 0.00 0.00 0.00
0.00 -0.09 -1.95 0.00 0.00 0.00
1.01 -0.09 0.00 0.00 0.00 0.00
9999.99 9999.99 9999.99 9999.99 9999.99 9999.99
9999.99 9999.99 9999.99 9999.99 9999.99 9999.99
9999.99 9999.99 9999.99 9999.99 9999.99 9999.99
0.000000
sorry for the long explaination and my poor english
i appreciate any kind of help from you guys.
thank you.
Bookmarks