Go to Post We can't all be Dean. But with the right attitude and preparation, we can make careers out of our passions. - Richard Wallace [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 22-08-2006, 07:27
TomS TomS is offline
Registered User
no team
 
Join Date: Aug 2006
Location: Kiew
Posts: 3
TomS is an unknown quantity at this point
Data From C++ GUI to Excel/Notepad, Application Trouble

"Hi,
I need to get data from a C++ application to a spread sheet or notepad file, has anyone any idea how to do this. I have access to programme source code but not sure where to start."
__________________
Content hosting - Fixed rate loans
  #2   Spotlight this post!  
Unread 22-08-2006, 15:19
6600gt's Avatar
6600gt 6600gt is offline
Registered User
AKA: Lohit
FRC #0226 (Hammerhead)
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Troy, MI
Posts: 221
6600gt is a jewel in the rough6600gt is a jewel in the rough6600gt is a jewel in the rough
Re: Data From C++ GUI to Excel/Notepad, Application Trouble

Quote:
Originally Posted by TomS
"Hi,
I need to get data from a C++ application to a spread sheet or notepad file, has anyone any idea how to do this. I have access to programme source code but not sure where to start."
Are you using Visual C++? If yes, then download and install Visual C++ 2005 Express Edition form microsoft.com.
  #3   Spotlight this post!  
Unread 22-08-2006, 16:23
Noah Kleinberg Noah Kleinberg is offline
Registered User
FRC #0395 (2TrainRobotics)
Team Role: Driver
 
Join Date: Jan 2006
Rookie Year: 2006
Location: New York
Posts: 196
Noah Kleinberg is a splendid one to beholdNoah Kleinberg is a splendid one to beholdNoah Kleinberg is a splendid one to beholdNoah Kleinberg is a splendid one to beholdNoah Kleinberg is a splendid one to beholdNoah Kleinberg is a splendid one to behold
Send a message via AIM to Noah Kleinberg
Re: Data From C++ GUI to Excel/Notepad, Application Trouble

Quote:
Originally Posted by TomS
"Hi,
I need to get data from a C++ application to a spread sheet or notepad file, has anyone any idea how to do this. I have access to programme source code but not sure where to start."
A "notepad file" would be easier to output to than a spread sheet, which would require you to research the file-format.

To output to a file from a C++ program, you have a few choices.

1) The program can output all of the data you need to a command line, and then when you run the program run it as:

your_program.exe > file_with_data.txt

The ">" tells the command line to take all of the text that was outputted to stdout (which is what cout and printf do) and put it into the file following the ">" sign, in this case "file_with_data.txt"

2) There is a standard library for outputting to files for C++ from within the program. It's called 'fstream', so you would put "#include <fstream>" at the beginning of your program.

To use this, you would need to make an fstream object at the beginning of your program, and then use it like "cout" to output data. Here's an example:

Code:
fstream file_output; // create an 'fstream' object
file_output.open("my_filename.txt"); // open the file 'my_filename.txt'
//whenever you want to output data:
file_output << "This goes into the file";
//and at the end to close the file:
file_output.close();
You could google 'fstream' or 'file i/o tutorial' for more/better help.

Hope that was clear, good luck
  #4   Spotlight this post!  
Unread 30-08-2006, 22:21
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,078
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: Data From C++ GUI to Excel/Notepad, Application Trouble

If you want to output to a spreadsheet, look into CSV. Excel and most other spreadsheet tools can read it automatically.

It's basically just like writing to a text file, but inserting commas and carriage returns to denote rows/columns.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
live input/output to/from application MarkH Programming 3 06-04-2006 01:43
Getting data from the robot mfwit LabView and Data Acquisition 1 19-02-2006 20:07
How do I declare a string and pass it from a Visual Basic GUI to a C++ DLL? complete Programming 0 14-01-2006 17:35
Color Picker gone from GUI. Firestorm Programming 2 14-02-2005 21:54
Program to copy list of files from Windows explorer as text into an application? Elgin Clock IT / Communications 6 30-12-2004 21:23


All times are GMT -5. The time now is 23:01.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi