View previous topic :: View next topic |
Author |
Message |
ajaytaneja
Joined: 08 Apr 2011 Posts: 17
|
Posted: Sun Aug 13, 2017 12:41 pm Post subject: Notepad file from FORTRAN |
|
|
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] |
|
Back to top |
|
|
JohnCampbell
Joined: 16 Feb 2006 Posts: 2554 Location: Sydney
|
Posted: Sun Aug 13, 2017 2:48 pm Post subject: |
|
|
The following is a start: Code: | 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 |
|
|
Back to top |
|
|
John-Silver
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Wed Aug 16, 2017 1:29 pm Post subject: |
|
|
Quote: | and for the next successive lines I want to have spaces / tabs as below |
§I'm not sure the question is clear ....
I don't see any spaces/tabs on the lines after the 1st 2 !!!!
It would help if there were some data on those lines ! |
|
Back to top |
|
|
|