Changeset 2289 in Sophya


Ignore:
Timestamp:
Dec 5, 2002, 3:27:27 PM (23 years ago)
Author:
cmv
Message:

option separateur et comment line dans mtxfrascii rz 5/12/02

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PIext/basexecut.cc

    r2275 r2289  
    779779else if ((kw == "mtxfrascii") || (kw == "vecfrascii") ) {
    780780  if(tokens.size() < 2) {
    781     cout<<"Usage: mtxfrascii/vecfrascii mtx/vec_name file_name "<<endl;
     781    cout<<"Usage: mtxfrascii/vecfrascii mtx/vec_name file_name [CommLine Separator]"<<endl;
    782782    return(0);
    783783    }
     
    792792  ifstream is(tokens[1].c_str());
    793793  sa_size_t nr, nc;
     794  char clm = '#';
     795  string sep = " \t";
     796  if (tokens.size()>2) clm = tokens[2][0];
     797  if (tokens.size()>3) sep = tokens[3];
    794798  if (kw == "mtxfrascii") {
    795     mtx.ReadASCII(is, nr, nc);
     799    mtx.ReadASCII(is, nr, nc, clm, sep.c_str());
    796800    mObjMgr->AddObj(mtx, tokens[0]);   
    797801    cout << "mtxfrascii: TMatrix<r_8> " << tokens[0] << " read from file "
     
    799803  }
    800804  else {
    801     vec.ReadASCII(is, nr, nc);
     805    vec.ReadASCII(is, nr, nc, clm, sep.c_str());
    802806    mObjMgr->AddObj(vec, tokens[0]);   
    803807    cout << "vecfrascii: TVector<r_8> " << tokens[0] << " read from file "
     
    12571261kw = "mtxfrascii";
    12581262usage = "Reads a matrix from an ASCII file (TMatrix<r_8>)";
    1259 usage += "\n Usage: mtxfrascii mtx_name file_name";
     1263usage += "\n Usage: mtxfrascii mtx_name file_name [CommChar Separator]";
    12601264usage += "\n  Related commands: arrtoascii vecfrascii ntfrascii ";
    12611265mpiac->RegisterCommand(kw, usage, this, "FileIO");
     
    12631267usage = "Reads a vector from an ASCII file (TVector<r_8>)";
    12641268usage += "\n Usage: vecfrascii vec_name file_name";
    1265 usage += "\n  Related commands: arrtoascii mtxfrascii ntfrascii ";
     1269usage += "\n  Related commands: arrtoascii mtxfrascii ntfrascii [CommChar Separator]";
    12661270mpiac->RegisterCommand(kw, usage, this, "FileIO");
    12671271kw = "arrtoascii";
Note: See TracChangeset for help on using the changeset viewer.