Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Fortran > modify data at ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 9 Topic 8166 of 8471
Post > Topic >>

modify data at a specific line and columns

by elijah <milyas7@[EMAIL PROTECTED] > Apr 23, 2008 at 03:08 AM

program main
         integer ln
         real    newval,oldval
         ln=178
         open(unit=10,file='file.txt',
     &        status='old',form='FORMATTED',access='sequential')
         rewind 10
         do n=1,ln-1,1
            if(n.eq.ln)then
               read(10,20)oldval
            endif
         enddo
         write(*,*)'Old value was'
         write(*,20)oldval
         do n=1,ln-1,1
            if(n.eq.ln)then
               write(10,20),newval
            endif
         enddo
         write(*,*)'New value is'
         write(*,20)newval
   20    format(10x,f10.3)
         close(10)
      end program

in the above program I would like to modify the columns 11-20 in line
178 of "file.txt". Text file contains lines of different lengths,
character strings, floating point numbers etc.

It seems that I am unable to locate ****perly the columns and/or the
line.
Any help will be much appreciated.

regards
MI
 




 9 Posts in Topic:
modify data at a specific line and columns
elijah <milyas7@[EMAIL  2008-04-23 03:08:07 
Re: modify data at a specific line and columns
e p chandler <epc8@[EM  2008-04-23 04:22:07 
Re: modify data at a specific line and columns
elijah <milyas7@[EMAIL  2008-04-23 04:47:27 
Re: modify data at a specific line and columns
Arjen Markus <arjen.ma  2008-04-23 04:54:49 
Re: modify data at a specific line and columns
e p chandler <epc8@[EM  2008-04-23 05:10:22 
Re: modify data at a specific line and columns
elijah <milyas7@[EMAIL  2008-04-23 09:54:08 
Re: modify data at a specific line and columns
e p chandler <epc8@[EM  2008-04-23 10:51:43 
Re: modify data at a specific line and columns
"James Van Buskirk&q  2008-04-23 12:01:33 
Re: modify data at a specific line and columns
elijah <milyas7@[EMAIL  2008-04-24 03:32:42 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Jul 9 6:00:39 CDT 2008.