Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
IBE FT ParseFileName
//Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23506 for x64 #include <iostream> #include <atlstr.h> CString parseFileName(CString filename) { CString ext(filename.Mid(44, 3)); ext.MakeLower(); CString filenameOUT(""); filenameOUT.Format("%s_%s%s_%s_%s%s.%s", filename.Mid(27, 4), //XXXX filename.Mid(5, 2), //YY filename.Mid(33, 1), //I filename.Mid(31, 2), //TT filename.Mid(37, 6), //DDMMAA filename.Mid(51, 1), //G ext); //TIP return filenameOUT; } int main() { CString f = CString("BALK.YL.CODBST00.D1010001.TDD3K041.DX231117.MOV.001P.YLEC2403.TMP"); std::cout << "CD_APLI: " << f.Mid(5, 2) << "\n"; std::cout << "CD_ETCA: " << f.Mid(27, 4) << "\n"; std::cout << "CD_SERV_BKED: " << f.Mid(48, 3) << "\n"; std::cout << "NM_ARQU_RETN: " << parseFileName(f) << "\n"; std::cout << "TP_ARQU_RETN: " << f.Mid(44, 3) << "\n"; std::cout << "CD_SUBS: " << f.Mid(33, 1) << "\n"; std::cout << "NM_ARQU_HOST: " << f.Left(43) << "\n"; std::cout << "CD_LAYOUT_BKED: " << f.Mid(53, 8) << "\n"; std::cout << "DH_MOVI: " << f.Mid(37, 6) << "\n"; if (f.GetLength() <= 65){ std::cout << "NR_CONVENIO: \"\"" << "\n"; } else { std::cout << "NR_CONVENIO: " << (LPCTSTR)f.Right(20) << "\n"; } CString nrCtrArquivo = (((LPCTSTR)f.Mid(31, 2))); const char *pszNumber = nrCtrArquivo; char *pEnd; long int valor = strtol (pszNumber,&pEnd,36); char val[5]; itoa(valor,val,10); std::cout << "NR_CTRL_ARQU_RETN: " << CString(val) << "\n"; }
run
|
edit
|
history
|
help
0
DCapSurfaceDesc
fusion adapt 64 members v2
Copy double[2][3] into vector<vector<double>>
typeid VC++
print adapted struct
_countof constexpr
calling convention is part of type(?)
Computing the factorial of an integer using factorial and iteration
ToString library for C++
hangman