|
|
|||||||
| Home | Forums | Rules | Articles | Store | Gallery | Blogs | Register | Donations | FAQ | Calendar | Search | Today's Posts | Mark Forums Read | Search |
| Everything Else Anything related to audio / video / electronics etc) BUT remember- we have many new forums where your thread may now fit! .... Parts, Equipment & Tools, Construction Tips, Software Tools...... |
|
Please consider donating to help us continue to serve you.
Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving |
|
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
diyAudio Member
Join Date: Jul 2002
Location: England
|
I'm not sure this belongs here (if on the site at all), but I have a programming question.
Is there a standard c++ function to read tab-seperated files? Cheers for looking
__________________
...if it ain't broke don't fix it - make it BETTER! |
|
|
|
|
#2 |
|
diyAudio Member
Join Date: Dec 2001
Location: Pittsburgh, PA, USA
|
Haha. No, but it shouldn't be too hard unless you have outlandish requirements for the data structure you are building from the text. For string manipulation it is probably easiest to use Perl--you can probably read an entire file in and split it into arrays in a couple of lines.
|
|
|
|
|
#3 | |
|
Banned
Join Date: Apr 2003
|
Quote:
1) Use an ifstream file stream object and use its getline() function to get each line of the file into a character buffer. 2) Use the standard C function strtok() on the buffer, passing in "\t" as the delimiter. Each call to strtok() will put a null byte in the next occurrence of the tab character and return a pointer to the beginning the token. |
|
|
|
|
|
#4 |
|
diyAudio Member
Join Date: Jan 2003
Location: UK (south west)
|
Actually, there are no functions in C++ as there are no standard C++ function / class libraries (although there is a template library - STL - but not recomended for microsoft C++) !!
Dave |
|
|
|
|
#5 |
|
Banned
Join Date: Apr 2003
|
Here's a book on the C++ standard library that I recommend very highly. It's really excellent.
http://www.amazon.com/exec/obidos/tg...glance&s=books |
|
|
|
|
#6 | |
|
diyAudio Member
Join Date: Feb 2003
Location: Jakarta
|
Quote:
That is for beginners who need the book for learning. For experts, the book may only be needed for reference, and hence completeness is more important than structure. |
|
|
|
|
|
#7 |
|
diyAudio Member
Join Date: Sep 2002
Location: Sweden
|
Just for your info, the C++ standard (or more precisely the
draft version of it) is available on line at ftp://ftp.research.att.com/dist/c++std/WP/CD2/ There are also plentiful of info on Stroustrups homepage www.research.att.com/~bs/C++.html |
|
|
|
|
#8 | |
|
Banned
Join Date: Apr 2003
|
Quote:
|
|
|
|
|
|
#9 | |
|
diyAudio Member
Join Date: Feb 2003
Location: Jakarta
|
Quote:
|
|
|
|
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
|
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| A simple question from a simple man. | inteificio | Solid State | 5 | 17th October 2005 03:00 PM |
| Simple Question | zeonrider | Solid State | 2 | 3rd October 2005 10:56 PM |
| Simple question... | Quattor | Solid State | 7 | 23rd June 2004 05:41 PM |
| Simple answer required for a simple question... | rabbitz | Multi-Way | 4 | 31st August 2003 10:05 AM |
| A Simple Question | OMNIFEX | Multi-Way | 3 | 19th July 2003 08:11 PM |
| New To Site? | Need Help? |
| Page generated in 0.14446 seconds (64.67% PHP - 35.33% MySQL) with 10 queries |