Silverfrost Forums

Welcome to our forums

Notepad file from FORTRAN

13 Aug 2017 11:41 #20003

Hi,

This might not be a direct FORTAN question but I'm doing some programming in FTN95 and I want to get a nodepad file in a typical format.

For example, I want to write in my notepad file a word 'ELEMNAME' as below to the extreme left of the first line of my notepad file (no spaces) and for the next successive lines I want to have spaces / tabs as below.

Can someone advise how to tell FTN 95 to insert the requisite number of spaces as I want (see text below)

Thanks ATEE

ELEMNAME
1 40 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
29 30 31 32 33 34 35 36 37 38 39 40 [/img]

13 Aug 2017 1:48 #20004

The following is a start: integer i,n ! open (21,file='notepad.txt') write (21,10) 'ELEMNAME' n = 40 write (21,11) 1,n,0,0 do i = 1,n write (21,11) i end do 10 format (a) 11 format (5(i0,1x)) end

Please login to reply.