Hi,
I want to convert a text file to a excel file using C++. Can anyone help? thnx
Hi,
I want to convert a text file to a excel file using C++. Can anyone help? thnx
How? What kind of text file, to what kind of Excel file? Be specific.
Code:#include <stdio.h> void J(char*a){int f,i=0,c='1';for(;a[i]!='0';++i)if(i==81){ puts(a);return;}for(;c<='9';++c){for(f=0;f<9;++f)if(a[i-i%27+i%9 /3*3+f/3*9+f%3]==c||a[i%9+f*9]==c||a[i-i%9+f]==c)goto e;a[i]=c;J(a);a[i] ='0';e:;}}int main(int c,char**v){int t=0;if(c>1){for(;v[1][ t];++t);if(t==81){J(v[1]);return 0;}}puts("sudoku [0-9]{81}");return 1;}
comvert to what?Originally Posted by juju
The text file is a notepad file with the extension .txt and I want to convert this file into an excel one. More specific, the data in the text file should be stored in rows and columns of the excel file.thnx for your time
So does your text file contain data separated by commas, spaces or tabs?
Excel can import this kind of file automatically.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
the data in the excel file is seperated by space. I need to do the conversion by a c++ program not directly from excel.
I mentioned something about writing plain text to an Excel file
here Very straightforward because as Salem said, Excel can
import plain text.
No No's:
fflush (stdin); gets (); void main ();
Goodies:
Example of fgets (); The FAQ, C/C++ Reference
My Gear:
OS - Windows XP
IDE - MS Visual C++ 2008 Express Edition
ASCII stupid question, get a stupid ANSI
You might start with the MSDN Office Developer Center
Take a look at Getting Started With Excel.
You're probably gong to need Visual Studio and Visual Studio Tools for Office Development.
And, you're probably going to need a couple of weeks to figure all of that out!
It would probably be easier with Visual Basic for Applications, than with C++.
have a look at this. http://www.wotsit.org/download.asp?f=excel
it's the file specification format for most versions of excel. You can read in the data from your text file and just export it in this format.
"I saw a sign that said 'Drink Canada Dry', so I started"
-- Brendan Behan
Free Compiler: Visual C++ 2005 Express
If you program in C++, you need Boost. You should also know how to use the Standard Library (STL). Want to make games? After reading this, I don't like WxWidgets anymore. Want to add some scripting to your App?
Thank you for your time and ideas