wc for File class

Anything that doesn't fit elsewhere.
Post Reply
bhalterm
Posts: 52
Joined: Wed Mar 08, 2006 10:43 am
Location: University of Pennsylvania

wc for File class

Post by bhalterm »

is there something similar to wc for the file class? I read through the Programmer's Reference section, but didn't see anything. All I'm trying to do is initialize a vector to the exact length necessary to read values from a given file of doubles. I can think of several reasonable ways to do it, but it seems like there is probably a really really easy way that I'm missing.
ted
Site Admin
Posts: 6394
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Post by ted »

No, but feel free to implement one.
ted
Site Admin
Posts: 6394
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Post by ted »

If you're using UNIX/Linux/OS X, or MSWin with an installation of cygwin that includes wc,
you could take advantage of hoc's system() procedure, which makes the OS's shell
execute a command. Also recall that hoc's printf() can be used to assemble command
strings.
Post Reply