Fortran77 write file to excel

  • Fortran
  • Thread starter mme58105
  • Start date
  • #1
5
0
I have problem don't use tab to seperate cell for writing file to excel.
this algorithm write file to excel one cell only.i want write file seperate cell on excel file.
please suggest me about algorithm write file in excel file.
 

Answers and Replies

  • #2
jtbell
Mentor
15,755
3,963
Unfortunately your question isn't clear. Are you asking how to write a tab into a Fortran output file? If yes, here's an example:

Code:
      open (unit=10, file='excel.txt')
      write (10,*) 3.14159, char(9), 2.71828, char(9), 1.4142
      close (unit=10)
      end

This produces a tab-delimited text file with three numbers, that excel can read. I had to click through two screens in Excel's file-import wizard, first to choose that the file is delimited, second to choose the delimiter (tab). Each number goes into a separate cell.
 
Last edited:
  • #3
5
0
I write program follow as below.I have problem data after write to excel file don't seperate cell.Please suggest me.
Algorithm
program writefile
implicit real*8(a-h,o-z)
integer*8 a1,a2,a3
real*8 b1,b2,b3
b1=1.0d+00
b2=2.0d+00
b3=3.0d+00

open(unit=7,file='writefile.xls',status='unknown')
write(7,300) b1,b2,b3
300 format(2x,'Load',f6.1/
*,2x,'Height',f6.1/
*,2x,'Deflect',f6.1)
stop
end
Result
Load 1.0
Height 2.0
Deflect 3.0
 
  • #4
rcgldr
Homework Helper
8,749
553
Writing a true Excel file would be complex. I assume you're trying to write a comma delimited text file that Excel can then import. If you suffiix the file name with .CSV, Excell will assume it's a comma separated value text file. Otherwise, you'll have to select comma delimited file as the file type when you do the import.
 
  • #5
5
0
Writing a true Excel file would be complex. I assume you're trying to write a comma delimited text file that Excel can then import. If you suffiix the file name with .CSV, Excell will assume it's a comma separated value text file. Otherwise, you'll have to select comma delimited file as the file type when you do the import.

Thank you very much
 

Related Threads on Fortran77 write file to excel

Replies
2
Views
3K
Replies
1
Views
1K
Replies
5
Views
5K
  • Last Post
Replies
1
Views
2K
Replies
1
Views
722
  • Last Post
Replies
10
Views
11K
Replies
9
Views
16K
  • Last Post
Replies
3
Views
4K
Replies
2
Views
25K
Top