- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I compiled a .exe file and it outputs a huge amount of data. How do I make it output to an Excel file or at least put it into columns that I can copy and paste? Thank you!
Link Copied
8 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
[cpp]program example real(8), dimension(5):: a,b data a/1.0,2.0,3.0,4.0,5.0/,b/6.0,7.0,8.0,9.0,10.0/ open(unit=5,file='ab.txt', status='unknown') write(5,6) a,b 6 format(5f5.1,/5f5.1) end [/cpp]the output in a text file (ab.txt) looks like this
1.0 2.0 3.0 4.0 5.0
6.0 7.0 8.0 9.0 10.0
6.0 7.0 8.0 9.0 10.0
the key here is having good knowledge in 'open' and 'format' statements !
HTH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - bobae
I compiled a .exe file and it outputs a huge amount of data. How do I make it output to an Excel file or at least put it into columns that I can copy and paste? Thank you!
I use a formatted write with fixed length fields. Use .TXT as file type. Excel will prompt you as to if the file is to be comma delimited or fixed. It does a good job as long as you do not have more that 65,000 lines. Once read in, Save As to Excel Workbook format. With formatted write you can write a rather large number of columns. If you get unwanted line break look at using the RECL specifier in the OPEN.
What is your definition of "huge amount of data"?
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can also add CHAR(9) between each numerical value (add "A" format descriptor to the format statement). The file then is a tab-delimited text file, which Excels import wizard will recognize an immediately parse the data into cells.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'd suggest you trythe following:
1) output to a file with suffix CSV (Comma delimited)
2)insert a comma between variables in your output format statements.
then Excel or other database programs can easily import the data.
1) output to a file with suffix CSV (Comma delimited)
2)insert a comma between variables in your output format statements.
then Excel or other database programs can easily import the data.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I use the following simple formated output statements to get my data out for use in MATLAB. Matlab automatically detect the format and load it without any problem and I guess same would be with excel. Itwrites data in rows and my output is normallyabout 1000 rows of NLX data points (columns)
OPEN(101, FILE='Output_Sc.dat')! open output file to write Sc
WRITE(101,5)(Sc(IP), IP=1,NLX)! write Sc in file
5 FORMAT (1701E10.2, T1)!1701(=NLX) is number of data points/colums
I hope may be helpful to you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello!
If you do not like these intermediate files you may want to have a look at the AUTODICE example (part of older versions of the compiler).
Wolfgang
If you do not like these intermediate files you may want to have a look at the AUTODICE example (part of older versions of the compiler).
Wolfgang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
AUTODICE is part of the current product samples.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - bobae
I compiled a .exe file and it outputs a huge amount of data. How do I make it output to an Excel file or at least put it into columns that I can copy and paste? Thank you!
qtXLS
qtXLS uses Excel's ODBC driver (comes with Excel) to read from and to write to Excel files (.xls) directly. Here is more information:
http://www.qtsoftware.de/vertrieb/db/qtxls_e.htm
Regards,
Joerg Kuthe
www.qtsoftware.de

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page