- #1
ethyl
- 7
- 0
Is there any code that i can use to execute a file through a fortran compiler? For example i want to execute an excel file (kk.xls) just before the termination of the main code.
Thank you
Thank you
I don't know about the Fortran compiler. Using the ShellExecute() function in C / C++, you could choose to "open" or "edit" the file, which would autolaunch Excel if the file had an "Excel" associated suffix, such as SAMPLE.XLS. You could also to choose to "open" Excel.EXE with your created SAMPLE.XLS file as a parameter.ethyl said:You mean the file that contains the fortran code or the excel file?ShellExecute()
Output a text file SAMPLE.TXT, then open this with Excel.ethyl said:1) Is there any code that can make a fortran compiler to export data to an excel file?
1) Is there any code that can make a fortran compiler to export data to an excel file?
But not just OPEN(3,FILE='Z2.xls') for example because it is inserting the data in a messed up way and i can not draw a graph.
2)Also another in fortran code let's say we ve got OPEN(2,FILE='kk1.DAT') The part of the code in
' ' is understood by fortran as the name of the file that will open. Can i make 1 to be a variable so if i create a loop the name of the file will take the value of the variable. For example OPEN(2,FILE='kkX.DAT') where X will be the variable.
ChrisLeslie said:Yes you can do this. You will have to create the file name as a string variable by concatenating various components. First convert the number variable to an ascii character string, then concatenate 'kk' + 'numberVariable + '.DAT' and call it something else. Then OPEN(2,FILE='somethingElse')
CHARACTER s*4 ! create string variabel 4 characters long
DO 10 i=1,5
WRITE(s,20) i ! convert integer i to string in s using format in 20
PRINT *, 'kk'//s//'.dat' ! concatenates 'kk' plus s plus '.dat'
10 CONTINUE
20 FORMAT(I4.4)
END
I have no idea what you are asking.Somy_sOMY said:i want to write a " if command" whit fortran which is too long.
"Execute Excel File w/Fortran Compiler Code" is a process in which a Fortran compiler is used to create an executable file that can run on an Excel spreadsheet. This allows for the integration of Fortran code into Excel, allowing for more complex calculations and data analysis.
The traditional Excel functions are built-in formulas that perform specific calculations or actions on data within a spreadsheet. "Execute Excel File w/Fortran Compiler Code" involves creating a customized executable file that can perform more complex calculations and analysis.
No, only certain Fortran compilers are compatible with Excel. Some popular options include Intel Fortran Compiler and GNU Fortran Compiler.
Using "Execute Excel File w/Fortran Compiler Code" allows for more advanced calculations and analysis to be performed within Excel, without the need for complex macros or add-ins. It also allows for easier integration and sharing of Fortran code with other Excel users.
One limitation is that the resulting executable file may not be compatible with all versions of Excel. Additionally, creating and editing the Fortran code may require a certain level of programming knowledge and experience.