|
|
 |
 |
 |
 |
Fortran Programming Language
|
 |
 |
 |
 |
 |
 |
 |
 |
Write to file
I need to change a txt file but when i use the fortran Write command to change it, the rest of the file content is erased. I can i change a txt file without erasing the rest of the file? Tanks...
Carvalho <jfscarva @gmail.com> wrote: > I need to change a txt file but when i use the fortran Write command > to change it, the rest of the file content is erased. I can i change > a txt file without erasing the rest of the file? Basically, no. That's the way sequential files work. In that statement does lie one hint. You can do things like that with a direct access file. However, normal text files aren't direct access. It is sometmes possible to do low-level tricks to use direct access to write on a normal text file, but that requires understanding of exactly what is going on at a system-dependent level. Usually, the most practical way to do things like that is to copy the file, making the modifications during the copy process. -- Richard Maine | Good judgement comes from experience; email: last name at domain . net | experience comes from bad judgement. domain: summertriangle | -- Mark Twain
Since its a text file, you can use any one of very many text editors. The copying and saving is all done "behind the scenes" with temporary files you don't have to know anything about. Some editors are limited to some large maximum file size. Some are essentially limited to some very large maximum line length (meaning you may not know where you are if you pass 999 characters in one line). Most (probably all) text editors are only usable if there are carriage- return or new-line codes (or preferably both) to separate the lines of text. Try the EDIT command on your computer (DOS) or Notepad (in Windows). I prefer Wordstar myself, or VEDIT. Very many are free or at least shareware.
Oh!, Wordstar and Edit both work with Spanish and Portugese as well as English, but Wordstar adds extra codes around any special character like accented vowels or in general any upper-half-ascii table symbols. Edit does not have this "problem" but works with smaller maximum file sizes. Notpad will fail with some upper-table symbols, distorting the file.
Terence wrote: > I prefer Wordstar myself, or VEDIT.
Crikey, WordStar! I haven't heard mention of that for years (decades even). Ah, memories. I typed my honours thesis on a PC-XT using WordStar... saving it to 5.25" floppies (dual sided, double density; very high tech). The hardest thing was getting the PC connected to the daisy wheel printer -- that I had to rent since the school didn't have any PC-connectable printers (that I could use at least). Man o man... what year is it again? :o) cheers, paulv -- Paul van Delst Ride lots. CIMSS @ NOAA/NCEP/EMC Eddy Merckx
On Thu, 12 Apr 2007 10:22:11 -0400, Paul van Delst <Paul.vanDe@noaa.gov> wrote in <evlfam$mt@news.nems.noaa.gov>: > Terence wrote: >> I prefer Wordstar myself, or VEDIT. > Crikey, WordStar! I haven't heard mention of that for years (decades even). Ah, memories. > I typed my honours thesis on a PC-XT using WordStar... saving it to 5.25" floppies (dual > sided, double density; very high tech). The hardest thing was getting the PC connected to > the daisy wheel printer -- that I had to rent since the school didn't have any > PC-connectable printers (that I could use at least).
Mine used a golf-ball printer -- driven by a secretary... > Man o man... what year is it again? :o)
Not long ago as the Institute of Physics thinks it was. For some unfathomable reason they have my "years in paid employment" as 87! -- Ivan Reid, School of Engineering & Design, _____________ CMS Collaboration, Brunel University. Ivan.Reid@[brunel.ac.uk|cern.ch] Room 40-1-B12, CERN KotPT -- "for stupidity above and beyond the call of duty".
|
 |
 |
 |
 |
|