For Programmers: Free Programming Magazines  


Home > Archive > Fortran > March 2006 > Reading a string from a file









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Reading a string from a file
rajibiitm

2006-03-24, 2:15 am

Dear all,

I am facing some problem regarding reading a string, which is placed at the middle of file, through fortran. This file is generated by a software.

I would like to know how to read that particular string, keeping all other things including format of the file remain same. Actually I would like to change some of the data under that particular string during each iteration.

Kindly help me.

I am providing here part of that file: I would like to read 'LINE-ELEMDAT TRUSS' and '@CLEAR' below that string. Also I am sending the full file (tenbar.txt).

Can any please provide me some suggestion.

Thank you,

Rajib
----------------------------------------------

FEPROGRAM
CONTROL FILEVERSION=V83
DATABASE NEW SAVE=NO PROMPT=NO
MASTER ANALYSIS=STATIC MODEX=EXECUTE TSTART=0.00000000000000,
IDOF=100111 OVALIZAT=NONE FLUIDPOT=AUTOMATIC CYCLICPA=1,
IPOSIT=STOP REACTION=YES INITIALS=NO FSINTERA=NO IRINT=DEFAULT,
CMASS=NO SHELLNDO=AUTOMATIC AUTOMATI=OFF SOLVER=SPARSE,
CONTACT-=CONSTRAINT-FUNCTION TRELEASE=0.00000000000000,
RESTART-=NO FRACTURE=NO LOAD-CAS=NO LOAD-PEN=NO MAXSOLME=0,
MTOTM=2 RECL=3000 SINGULAR=YES STIFFNES=1.00000000000000E-09,
MAP-OUTP=NONE MAP-FORM=NO NODAL-DE='' POROUS-C=NO ADAPTIVE=0,
ZOOM-LAB=1 AXIS-CYC=0 PERIODIC=NO VECTOR-S=GEOMETRY EPSI-FIR=NO,
STABILIZ=NO STABFACT=1.00000000000000E-12 RESULTS=PORTHOLE,
FEFCORR=NO
*
COORDINATES POINT SYSTEM=0
@CLEAR
1 0.00000000000000 0.00000000000000 0.00000000000000 0
2 0.00000000000000 360.000000000000 0.00000000000000 0
3 0.00000000000000 720.000000000000 0.00000000000000 0
4 0.00000000000000 0.00000000000000 360.000000000000 0
5 0.00000000000000 360.000000000000 360.000000000000 0
6 0.00000000000000 720.000000000000 360.000000000000 0
@
*
LINE STRAIGHT NAME=1 P1=1 P2=2
*
LINE STRAIGHT NAME=2 P1=2 P2=3
*
LINE STRAIGHT NAME=3 P1=4 P2=5
*
LINE STRAIGHT NAME=4 P1=5 P2=6
*
LINE STRAIGHT NAME=5 P1=6 P2=3
*
MATERIAL ELASTIC NAME=1 E=1.00000000000000E+07 NU=0.00000000000000 DENSITY=0.00000000000000 ALPHA=0.00000000000000 MDESCRIP='NONE'
*
LINE-ELEMDAT TRUSS
@CLEAR
1 1 2.50000000000000 'DEFAULT' 'DEFAULT' 0.00000000000000 0.00000000000000 0.00000000000000 'NO' 0.00000000000000
2 1 2.50000000000000 'DEFAULT' 'DEFAULT' 0.00000000000000 0.00000000000000 0.00000000000000 'NO' 0.00000000000000
3 1 2.50000000000000 'DEFAULT' 'DEFAULT' 0.00000000000000 0.00000000000000 0.00000000000000 'NO' 0.00000000000000
4 1 2.50000000000000 'DEFAULT' 'DEFAULT' 0.00000000000000 0.00000000000000 0.00000000000000 'NO' 0.00000000000000
5 1 2.50000000000000 'DEFAULT' 'DEFAULT' 0.00000000000000 0.00000000000000 0.00000000000000 'NO' 0.00000000000000
@
*
FIXBOUNDARY POINTS FIXITY=ALL
@CLEAR
1 'ALL'
4 'ALL'
@
*
GLINE NODES=2 NCOINCID=ENDS NCENDS=12 NCTOLERA=1.00000000000000E-05,
SUBSTRUC=0 GROUP=1 MIDNODES=CURVED
****
---------------------------------------------------------------------------LINE-ELEMDAT TRUSS @CLEAR
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com