--- In [email protected], "Victor A. Wagner Jr." <[EMAIL PROTECTED]> wrote:
>
> At 14:32 2007-04-21, Pedro von Wald wrote:
> >I am working on the school proj, but I am having some difficult in
> >processing the text file.
> >Basically I am using the following to process the content of the file
> >once it is copied to a mult. array (page[i][i]).
> 
> why an array?

yeah, I was considering using vectors, but I am more used to arrays
(from the old days). D

> why 2 dimensional?
> 
Like an array of the type char text[2000] would break down once it
found a \n (the text file has "carriage returns"). So I would need an
array for each line. Actually I don't know if it would break down or
not, I just wanted to be on the safe side so I went with a two
dimention array. Apparently it works, it may create more overhead though. 
My problem is to filter down all the extra spaces between characters.
Like in a text file I could have a sequence like:
"word1 word2 word3   word5  word6 word7 word8   word9" I have to
remove all the extra spaces so that there would be only one space
between each character and  that would make it easy to collect each
word individually to a different array which would contain the words
as individual entities. 
thanks!
-pedro

> 
> >for (int x = 0; x <= page[1][1].size(); x++)
> >     {
> >
> >
> >names[x][x]=page[1][1].substr(names[x][x].size(),page[1][1].find("
> >",names[x][x].size()));
> >       cout << " TESTING 2: " << names[x][x] << " SIZE: " <<
> >names[x][x].size();
> >     }
> >
> >where page is a mult. array that contains the file as a whole, and
> >name is a mult array that is supposed to obtain each individual word
> >inside the file. The problem is that the file has multiple spaces
> >between the words and at the end of lines, besides it also contains
> >"carriage returns" .
> >
> >The whole code can retrieved at:  http://rafb.net/p/e8phJy32.html
> >
> >thanks for any help,
> >-pedro
> >
> >
> >
> >
> >To unsubscribe, send a blank message to 
> ><mailto:[EMAIL PROTECTED]>.
> >Yahoo! Groups Links
> >
> >
> >
> 
> Victor A. Wagner Jr.      http://rudbek.com
> The five most dangerous words in the English language:
>                "There oughta be a law"
>

Reply via email to