formatted-input

Formatted input box in VB.NET

Is there a control or method to accept formatted input in VB.NET? i.e. It accepts input in a given format ##/##/## or similar? ...

C++ formatted input: how to 'skip' tokens?

Hi all! Suppose I have an input file in this format: VAL1 VAL2 VAL3 VAL1 VAL2 VAL3 I'm writing a program that would be interested only in VAL1 and VAL3. In C, if i wanted to 'skip' the second value, I'd do as follows: char VAL1[LENGTH]; char VAL3[LENGTH]; FILE * input_file; fscanf(input_file, "%s %*s %s", VAL1, VAL3); Meaning, I'd...

loading formatted data in VBA from a text file

I'm looking for the best way of loading formatted data in VBA. I’ve spent quite some time trying to find the equivalent of C-like or Fortran-like fscanf type functions, but without success. Basically I want to read from a text file millions of numbers placed on many (100,000’s) lines with 10 numbers each (except the last line, possibly...

Does anyone actually use stream extraction operators?

I've written tons of operator<<(std::ostream &, const T &) functions -- they're incredibly useful. I've never written an operator>>(std::istream &, T &) function in real code or even used the extraction operators for built-in types (OK, maybe for std::string). Are these appropriate only for short example programs and textbooks? Is ope...

Reading formatted data with C++'s stream operator >> when data has spaces

I have data in the following format: 4:How do you do? 10:Happy birthday 1:Purple monkey dishwasher 200:The Ancestral Territorial Imperatives of the Trumpeter Swan The number can be anywhere from 1 to 999, and the string is at most 255 characters long. I'm new to C++ and it seems a few sources recommend extracting formatted data with ...