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 for(it = values.begin() ; it != values.end() ; )
43 it = values.erase(it);
50 if(write_fi.is_open())
52 //Add each header input write to file
53 for(unsigned int i=0 ;i< headers.size(); i++ )
55 if(i==(headers.size()-1))
57 write_fi << headers[i] << "\n";
59 write_fi << headers[i] << "\t";
64 unsigned int colSize = values[0].size();
66 for(unsigned int j=0;j<colSize;j++)
68 for(unsigned int i=0;i<values.size();i++)
70 if(i==(values.size()-1))
72 write_fi << values[i][j] << "\n";
74 write_fi << values[i][j] << "\t";
82 }// if write_fi.is_open()
85 std::cout<<"No es posible abrir"<<std::endl;
90 bbSetOutputOutFileName(bbGetInputFileName().c_str());
92 std::cout << "MLER WriteColumnsString::End Process " << std::endl;
96 // 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)
98 void WriteColumnsString::bbUserSetDefaultValues()
101 // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
102 // Here we initialize the input 'In' to 0
103 bbSetInputFileName("");
107 // 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)
109 void WriteColumnsString::bbUserInitializeProcessing()
112 // THE INITIALIZATION METHOD BODY :
114 // but this is where you should allocate the internal/output pointers
120 // 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)
122 void WriteColumnsString::bbUserFinalizeProcessing()
125 // THE FINALIZATION METHOD BODY :
127 // but this is where you should desallocate the internal/output pointers
132 // EO namespace bbstd