2 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
4 #include "bbstdWriteColumnsString.h"
5 #include "bbstdPackage.h"
9 BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,WriteColumnsString)
10 BBTK_BLACK_BOX_IMPLEMENTATION(WriteColumnsString,bbtk::AtomicBlackBox);
12 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
14 void WriteColumnsString::Process()
17 std::cout << "MLER WriteColumnsString::Process Start " << std::endl;
20 std::ofstream write_fi;
21 write_fi.open(bbGetInputFileName().c_str());
23 std::vector<std::string> headers = bbGetInputHeaders(); //Headers Input
25 std::vector<std::vector<std::string> > values;
27 values.push_back(bbGetInputlstData1());
28 values.push_back(bbGetInputlstData2());
29 values.push_back(bbGetInputlstData3());
30 values.push_back(bbGetInputlstData4());
31 values.push_back(bbGetInputlstData5());
32 values.push_back(bbGetInputlstData6());
33 values.push_back(bbGetInputlstData7());
34 values.push_back(bbGetInputlstData8());
35 values.push_back(bbGetInputlstData9());
37 std::vector<std::vector<std::string> >::iterator it;
39 std::cout << "values size"<<values.size()<< std::endl;
40 for(it = values.begin() ; it != values.end() ; )
44 it = values.erase(it);
50 std::cout << "values size"<<values.size()<< std::endl;
52 if(write_fi.is_open())
54 //Add each header input write to file
55 for(unsigned int i=0 ;i< headers.size(); i++ )
57 if(i==(headers.size()-1))
59 write_fi << headers[i] << "\n";
61 write_fi << headers[i] << "\t";
66 unsigned int colSize = values[0].size();
68 for(unsigned int j=0;j<colSize;j++)
70 for(unsigned int i=0;i<values.size();i++)
72 if(i==(values.size()-1))
74 write_fi << values[i][j] << "\n";
76 write_fi << values[i][j] << "\t";
84 }// if write_fi.is_open()
87 std::cout<<"No es posible abrir"<<std::endl;
92 bbSetOutputOutFileName(bbGetInputFileName().c_str());
94 std::cout << "MLER WriteColumnsString::End Process " << std::endl;
98 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
100 void WriteColumnsString::bbUserSetDefaultValues()
103 // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
104 // Here we initialize the input 'In' to 0
105 bbSetInputFileName("");
109 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
111 void WriteColumnsString::bbUserInitializeProcessing()
114 // THE INITIALIZATION METHOD BODY :
116 // but this is where you should allocate the internal/output pointers
122 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
124 void WriteColumnsString::bbUserFinalizeProcessing()
127 // THE FINALIZATION METHOD BODY :
129 // but this is where you should desallocate the internal/output pointers
134 // EO namespace bbstd