Showing posts with label replace. Show all posts
Showing posts with label replace. Show all posts
2013/04/30
TextCrawler - 간단하고 편리한 텍스트 파일 변환(바꾸기) 프로그램
OpenCV 64비트용 라이브러리를 만들면서 알게된 프로그램이다. OpenCV가 배포될 때 64비트용 dll과 lib가 배포되지만 32비트용과 64비트용이 이름이 같아 동일 경로에서 사용할 수 없어 이를 구분하기 위해 재 컴파일을 하는데 많은 프로젝트 파일안에 포함되어 있는 이름들을 하나씩 수작업으로 바꾸는 일은 매우 시간이 걸리고 귀찮은 작업이였는데 TextCrawler 를 이용하는 쉽게 해결이 되었다.
프로그램은 간단한 UI로 구성되어 있지만 많은 기능을 포함하고 있다. 파일 또는 폴더를 지정할 수 있고 폴더의 경우 필터링과 예외파일 지정도 가능 하다.
바꾸기는 일반적인 바꾸기 기능과 정규식 그리고 배치 처리도 지원하여 쉽게 바꾸지 작업을 할 수 있다.
TextCrawler 포럼
TextCrawler 2.3 Releas
Original Post : http://neodreamer-dev.tistory.com/702
Labels:
Find
,
Find and Replace
,
replace
,
Text File Tools
,
TextCrawler
,
TistoryOldPost
,
찾기&바꾸기
2009/02/10
[MFC] CString 의 문자/문자열 삭제 및 치환하기
CString 의 멤버 함수인 Remove 와 Replace 의 활용 예이다.
Remove 함수는 문자열에서 지정된 문자를 삭제하고 Replace 는 문자열에서 지정된 문자 또는 문자열을 다를 문자나 문자열로 치환한다.
MSDN 사이트에서 발췌한 Replace 사용 예.
http://msdn.microsoft.com/en-us/library/aa300582(VS.60).aspx
MSDN 사이트에서 발췌한 Remove 사용 예.
http://msdn.microsoft.com/en-us/library/aa300579(VS.60).aspx
Remove 함수는 문자열에서 지정된 문자를 삭제하고 Replace 는 문자열에서 지정된 문자 또는 문자열을 다를 문자나 문자열로 치환한다.
strValue = _T("Hello World!!");
int nCh = strValue.Replace( _T('l'), _T('w') );
TRACE2( "Replaced %d : %s
\n", nCh, strValue );
nCh = strValue.Replace( _T("ww"), _T("ll") );
TRACE2( "Replaced %d : %s
\n", nCh, strValue );
nCh = strValue.Remove( _T('!') );
TRACE2( "Removed %d : %s
\n", nCh, strValue );
#결과
Replaced 3 : Hewwo Worwd!!
Replaced 1 : Hello Worwd!!
Removed 2 : Hello Worwd
MSDN 사이트에서 발췌한 Replace 사용 예.
http://msdn.microsoft.com/en-us/library/aa300582(VS.60).aspx
//First example, with old and new equal in length.
CString strZap("C--");
int n = strZap.Replace('-', '+');
ASSERT(n == 2);
ASSERT(strZap == "C++");
//Second example, old and new are of different lengths.
CString strBang("Everybody likes ice hockey");
n = strBang.Replace("hockey", "golf");
ASSERT(n == 1);
n = strBang.Replace("likes", "plays");
ASSERT(n == 1);
n = strBang.Replace("ice", NULL);
ASSERT(n == 1);
ASSERT(strBang == "Everybody plays golf");
// note that you now have an extra space in your
// sentence. To remove the extra space, include it
// in the string to be replaced, i.e.,"ice ".
MSDN 사이트에서 발췌한 Remove 사용 예.
http://msdn.microsoft.com/en-us/library/aa300579(VS.60).aspx
//remove the lower-case letter 't' from a sentence:
CString str("This is a test.");
int n = str.Remove('t');
ASSERT(n == 2);
ASSERT(str == "This is a es.");
Original Post : http://neodreamer-dev.tistory.com/250
Subscribe to:
Posts
(
Atom
)