63 "usage: pdastest [-v] [-n=val] [-c] [-s] filename ..." "\n" 64 " or: pdastest --help|-h" "\n" 71 "filename file to read" "\n" 74 "-n=val display only vale samples at start end end of file" "\n" 75 "-c only count samples" "\n" 80 using namespace tfxx::cmdline;
81 static Declare options[]=
99 cerr << usage_text << endl;
104 Commandline cmdline(iargc, argv, options);
107 if (cmdline.optset(0))
109 cerr << usage_text << endl;
110 cerr << help_text << endl;
116 opt.
count=cmdline.optset(2);
117 opt.
nprint=cmdline.int_arg(3);
142 while (cmdline.extra())
144 std::cout << std::endl;
145 std::string filename=cmdline.next();
146 std::cout <<
"file: " << filename << std::endl;
148 std::ifstream ifs(filename.c_str());
152 if (opt.
verbose) { is.free().write(std::cout); }
162 std::cout << is.wid2().line() << std::endl;
166 opt.
nprint < int(iseries.size()/2) ?
167 opt.
nprint : iseries.size()/2;
168 for (
int i=0; i<npr; ++i)
169 { std::cout << i <<
" " << iseries(i) << std::endl; }
170 std::cout <<
" ... " << std::endl;
171 for (
int i=iseries.size()-npr; i<int(iseries.size()); ++i)
172 { std::cout << i <<
" " << iseries(i) << std::endl; }
180 std::cout <<
"*** number of samples: " <<
187 std::cout <<
"*** number of samples: " <<
188 indata.size() <<
" ***" << std::endl;
190 opt.
nprint < int(indata.size()/2) ?
191 opt.
nprint : indata.size()/2;
192 for (
int i=0; i<npr; ++i)
193 { std::cout << i <<
" " << indata[i] << std::endl; }
194 std::cout <<
" ... " << std::endl;
195 for (
int i=indata.size()-npr; i<int(indata.size()); ++i)
196 { std::cout << i <<
" " << indata[i] << std::endl; }
void readdata(std::istream &is, Tdata &data, const Etype &type)
aff::Series< int > Tiseries
Header readheader(std::istream &is, const bool &verbose)
function to read the file header
int countdata(std::istream &is, const Etype &type)
function to skip the file data but count the samples
std::vector< Tvalue > Tdata