- #1
charlie87
- 8
- 0
The issue I am having is that I want to create a program which reads a .txt file and copies it exactly to a .inp file followed by some coordinates which I am generating. the . txt file is being used as a header file which can be changed outside the program but once the program is read in the new variables are automatically updated.
Below is the text which I want to read. is there a command for read all?
$title
simple wing
$datacheck
0.
$symmetry - xz plane of symmetry
=misymm mjsymm
1. 0.
$mach number
=amach
.6
$cases - no. of solutions
=nacase
1.
$angles-of-attack
=alpc
4.
=alpha(1) alpha(2) alpha(3)
0. 10. 0.
$printout options
=isings igeomp isingp icontp ibconp iedgep
4. 0. 0. 1. 1. 0.
=ipraic nexdgn ioutpr ifmcpr
.0 .0 1. 0. 3.
$references for accumulated forces and moments
=xref yref zref nref
46. 0. 0.
=sref bref cref dref
2400. 60. 40. 90.
$points - wing-body with composite panels
=kn cpnorm
1. 2.
=kt
1.
=nm nn netname
I than want this text to be written to a new file "pan.inp" in the same format.
Regards,
Charles Pearce
Below is the text which I want to read. is there a command for read all?
$title
simple wing
$datacheck
0.
$symmetry - xz plane of symmetry
=misymm mjsymm
1. 0.
$mach number
=amach
.6
$cases - no. of solutions
=nacase
1.
$angles-of-attack
=alpc
4.
=alpha(1) alpha(2) alpha(3)
0. 10. 0.
$printout options
=isings igeomp isingp icontp ibconp iedgep
4. 0. 0. 1. 1. 0.
=ipraic nexdgn ioutpr ifmcpr
.0 .0 1. 0. 3.
$references for accumulated forces and moments
=xref yref zref nref
46. 0. 0.
=sref bref cref dref
2400. 60. 40. 90.
$points - wing-body with composite panels
=kn cpnorm
1. 2.
=kt
1.
=nm nn netname
I than want this text to be written to a new file "pan.inp" in the same format.
Regards,
Charles Pearce