-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
86 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,54 @@ | ||
# excelColumnNumber | ||
|
||
- Convert a column string in Excel to a number. :kr: 엑셀 컬럼 문자열을 숫자료 변환합니다. | ||
|
||
- Using pure C++ and STL :kr: 씨플러스와 에스티엘만을 사용 | ||
- Convert a column string in Excel to a number. | ||
- :kr: 엑셀 컬럼 문자열을 숫자로 변환합니다. | ||
|
||
- Using pure C++ and STL | ||
- :kr: 씨플러스와 에스티엘만을 사용 | ||
|
||
## Example | ||
|
||
```cpp | ||
unsigned int debug1 = excelColumnNumber::excelColumnStingToNumber("AB"); | ||
std::string debug2 = excelColumnNumber::convertFromNumberToExcelColumn( debug1 ); | ||
assert( debug2 == "AB" ); | ||
std::cout << " [1] ------------ " << std::endl ; | ||
|
||
std::cout << " 0 : " << QXlsx::columnNumberToString( 0 ) << std::endl ; | ||
std::cout << " 1 : " << QXlsx::columnNumberToString( 1 ) << std::endl ; | ||
std::cout << " 2 : " << QXlsx::columnNumberToString( 2 ) << std::endl ; | ||
std::cout << " 100 : " << QXlsx::columnNumberToString( 100 ) << std::endl ; | ||
std::cout << " UINT_MAX : " << QXlsx::columnNumberToString( UINT_MAX ) << std::endl ; | ||
|
||
std::cout << " [2] ------------ " << std::endl ; | ||
|
||
std::cout << " a : " << QXlsx::alphabetToNumber('a') << std::endl ; | ||
std::cout << " z : " << QXlsx::alphabetToNumber('z') << std::endl ; | ||
std::cout << " A : " << QXlsx::alphabetToNumber('A') << std::endl ; | ||
std::cout << " Z : " << QXlsx::alphabetToNumber('Z') << std::endl ; | ||
std::cout << " 5 : " << QXlsx::alphabetToNumber('5') << std::endl ; | ||
|
||
std::cout << " [3] ------------ " << std::endl ; | ||
|
||
std::string columnString = "AB"; | ||
unsigned int debug1 = QXlsx::columnStringToNumber( columnString ); | ||
std::string debug2 = QXlsx::columnNumberToString( debug1 ); | ||
std::cout << debug1 << " " << debug2 << std::endl; | ||
assert( debug2 == columnString ); | ||
``` | ||
- Output : | ||
``` | ||
[1] ------------ | ||
0 : | ||
1 : A | ||
2 : B | ||
100 : CV | ||
UINT_MAX : MWLQKWU | ||
[2] ------------ | ||
a : 1 | ||
z : 26 | ||
A : 1 | ||
Z : 26 | ||
5 : 0 | ||
[3] ------------ | ||
28 AB | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters