Can Fortran77 Write a File to Excel without Using Tab Separation?

  • Context: Fortran 
  • Thread starter Thread starter mme58105
  • Start date Start date
  • Tags Tags
    Excel File Fortran77
Click For Summary

Discussion Overview

The discussion revolves around the challenges of writing data from Fortran77 to an Excel file without using tab separation. Participants explore various methods and algorithms for achieving this, focusing on file formats and data separation techniques.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant expresses a desire to write data to an Excel file without using tab separation and requests suggestions for an algorithm.
  • Another participant provides an example of writing a tab-delimited text file, questioning if the original poster is asking how to include tabs in the output.
  • A participant shares a Fortran program that attempts to write data to an Excel file but notes that the data does not appear in separate cells.
  • Some participants suggest that writing a true Excel file is complex and propose using a comma-delimited text file instead, indicating that naming the file with a .CSV extension could help Excel recognize the format.

Areas of Agreement / Disagreement

There is no consensus on the best approach to write data to Excel without tab separation. Multiple competing views exist regarding the file format and methods to achieve the desired outcome.

Contextual Notes

Participants have not resolved the specific limitations of the proposed algorithms, such as the need for proper formatting or the implications of using different file extensions.

mme58105
Messages
5
Reaction score
0
I have problem don't use tab to separate cell for writing file to excel.
this algorithm write file to excel one cell only.i want write file separate cell on excel file.
please suggest me about algorithm write file in excel file.
 
Technology news on Phys.org
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:
I write program follow as below.I have problem data after write to excel file don't separate 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
 
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.
 
rcgldr said:
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
 

Similar threads

Replies
27
Views
4K
Replies
8
Views
1K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
Replies
35
Views
8K
  • · Replies 14 ·
Replies
14
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K
Replies
81
Views
8K
  • · Replies 33 ·
2
Replies
33
Views
3K
  • · Replies 16 ·
Replies
16
Views
4K