forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Notepad file from FORTRAN

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General
View previous topic :: View next topic  
Author Message
ajaytaneja



Joined: 08 Apr 2011
Posts: 17

PostPosted: Sun Aug 13, 2017 12:41 pm    Post subject: Notepad file from FORTRAN Reply with quote

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
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Sun Aug 13, 2017 2:48 pm    Post subject: Reply with quote

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
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 1520
Location: Aerospace Valley

PostPosted: Wed Aug 16, 2017 1:29 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group