![]() | ![]() | | ![]() |
| ||||||
| Languages The various programming languages. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 |
| teh priesT! ![]() | Reading a CSV File Does anyone have a simple code for this ? C++ is way out of my league as i hvnt touched this language in over 4 years or more .. Any help will be highly appreciated ..
__________________ ------------------------------------------------ This space for Rent ------------------------------------------------ Buri nazar walle tera muh kalla |
| | |
| |
| | #2 |
| teh priesT! ![]() | Re: Reading a CSV File 1. The hint is in the file extension. 2. Loop through the file. 3. Stop at commas and process.
__________________ I can see much clearer now, I'm blind. |
| | |
| | #3 |
| teh priesT! ![]() | Re: Reading a CSV File I knw the method but its just the fact that i would have to learn the VC++ all over again .. Being lazy dsnt help also .. So if someone has it then no it would make my life a lot easier
__________________ ------------------------------------------------ This space for Rent ------------------------------------------------ Buri nazar walle tera muh kalla |
| | |
| | #4 |
| Microphone abuser! ![]() | Re: Reading a CSV File u can use strtok() function to get tokens separated by commas. |
| | |
| | #5 |
| teh priesT! ![]() | Re: Reading a CSV File ^ Yeah i was reading that .. could u perhaps explain wat does it excatly mean ? .. Also could u guys tell me which VC++ project type should i select for this .. I dont want any output so Win32 is out ..
__________________ ------------------------------------------------ This space for Rent ------------------------------------------------ Buri nazar walle tera muh kalla |
| | |
| | #6 | |
| Microphone abuser! ![]() | Re: Reading a CSV File no idea about VC++. About strtok(), check out some examples from the internet. Here's a brief info: suppose you have a file which has the following contents: a,b,c,d,e now, you want to read individual tokens separated by comma. Tokens are simply values that are separated by commas, for e.g. a b c etc... now, you can use strtok to get the tokens as follows: Quote:
I hope this helps... | |
| | |
| | #7 |
| teh priesT! ![]() | Re: Reading a CSV File Thanks monty .. I had some trouble implementing Strok with all these complier options in VC++ .. It worked but now i am using a string split function in VC++ .. Maybe we should have a code library in Erodov for such commonly used functions
__________________ ------------------------------------------------ This space for Rent ------------------------------------------------ Buri nazar walle tera muh kalla |
| | |
| | #8 |
| teh smartie pantS! ![]() | Re: Reading a CSV File ^^In VC++, File->New->Project->Win32->"Win32 Console Application" for all the console/dos applications.
__________________ CPU: Core 2 Duo E8400 @ stock settings with stock cooler Mobo: Gigabyte GA-EP35C-DS3R rev 2.1 RAM: 2GB Transcend DDR2 800Mhz (5-5-5) GPU: BFG Geforce 6600GT GDDR3 OC Edition (needs an upgrade) If you feel you have been exposed to radioactive or other hazardous materials in the course of your duties, contact your Radiation Safety Officer immediately! |
| | |
| |