Click here to Skip to main content
15,884,096 members
Articles / Desktop Programming / MFC

ScanR - Text file string search and replace engine

Rate me:
Please Sign up or sign in to vote.
4.30/5 (7 votes)
3 Jul 20035 min read 87.2K   3.7K   35  
A set of classes that allows you to search for strings in text files and replace them.
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"

#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"

/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS

/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32

#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//

1 TEXTINCLUDE DISCARDABLE 
BEGIN
    "resource.h\0"
END

2 TEXTINCLUDE DISCARDABLE 
BEGIN
    "#include ""afxres.h""\r\n"
    "\0"
END

3 TEXTINCLUDE DISCARDABLE 
BEGIN
    "#define _AFX_NO_SPLITTER_RESOURCES\r\n"
    "#define _AFX_NO_OLE_RESOURCES\r\n"
    "#define _AFX_NO_TRACKER_RESOURCES\r\n"
    "#define _AFX_NO_PROPERTY_RESOURCES\r\n"
    "\r\n"
    "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
    "#ifdef _WIN32\r\n"
    "LANGUAGE 9, 1\r\n"
    "#pragma code_page(1252)\r\n"
    "#endif //_WIN32\r\n"
    "#include ""res\\ScanR.rc2""  // non-Microsoft Visual C++ edited resources\r\n"
    "#include ""afxres.rc""         // Standard components\r\n"
    "#endif\r\n"
    "\0"
END

#endif    // APSTUDIO_INVOKED


/////////////////////////////////////////////////////////////////////////////
//
// Icon
//

// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDR_MAINFRAME           ICON    DISCARDABLE     "res\\ScanR.ico"

/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//

IDD_ABOUTBOX DIALOG DISCARDABLE  0, 0, 235, 55
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "About ScanR"
FONT 8, "MS Sans Serif"
BEGIN
    ICON            IDR_MAINFRAME,IDC_STATIC,11,17,20,20
    LTEXT           "ScanR Version 1.0",IDC_STATIC,40,10,119,8,SS_NOPREFIX
    LTEXT           "Copyright (C) 2003",IDC_STATIC,40,25,119,8
    DEFPUSHBUTTON   "OK",IDOK,178,7,50,14,WS_GROUP
END

IDD_SCANR_DIALOG DIALOGEX 0, 0, 335, 258
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW
CAPTION "ScanR - File scanner utility by Kamal Shankar."
FONT 8, "MS Sans Serif"
BEGIN
    DEFPUSHBUTTON   "Start",IDOK,140,224,50,14,BS_CENTER | BS_BOTTOM | 
                    BS_FLAT
    EDITTEXT        IDC_EDIT1,15,37,302,38,ES_MULTILINE | ES_AUTOHSCROLL | 
                    WS_VSCROLL
    GROUPBOX        " Enter the search string here ",IDC_STATIC,7,26,321,59,
                    WS_DISABLED
    EDITTEXT        IDC_EDIT2,15,108,303,36,ES_MULTILINE | ES_AUTOHSCROLL | 
                    WS_VSCROLL
    GROUPBOX        " Put replacement string here  ",IDC_STATIC,7,93,321,58,
                    WS_DISABLED
    EDITTEXT        IDC_EDIT3,13,170,41,13,ES_LOWERCASE | ES_AUTOHSCROLL
    GROUPBOX        " &File wildcard ",IDC_STATIC,7,160,57,26,WS_DISABLED
    EDITTEXT        IDC_EDIT4,13,233,52,12,ES_AUTOHSCROLL
    GROUPBOX        " &Directory wildcard ",IDC_STATIC,7,223,70,26,
                    WS_DISABLED
    EDITTEXT        IDC_EDIT5,126,170,56,13,ES_AUTOHSCROLL
    GROUPBOX        " Drive (&path) name",IDC_STATIC,119,159,72,43,
                    WS_DISABLED
    PUSHBUTTON      " Browse ..",IDC_BUTTON1,125,188,57,10,BS_FLAT
    EDITTEXT        IDC_EDIT6,13,203,70,12,ES_AUTOHSCROLL | ES_NUMBER
    GROUPBOX        " Max FileSize(bytes) ",IDC_STATIC,7,193,88,26,
                    WS_DISABLED
    CONTROL         " Be strict with grammar",IDC_CHECK1,"Button",
                    BS_AUTOCHECKBOX | WS_TABSTOP,206,167,108,9
    CONTROL         " Check only words",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | 
                    WS_TABSTOP,206,179,107,8
    CONTROL         " Ignore last word's punctuation",IDC_CHECK3,"Button",
                    BS_AUTOCHECKBOX | WS_TABSTOP,206,190,110,10
    CONTROL         " Case sensetive",IDC_CHECK4,"Button",BS_AUTOCHECKBOX | 
                    WS_TABSTOP,206,201,114,9
    CONTROL         " Overwrite original file",IDC_CHECK5,"Button",
                    BS_AUTOCHECKBOX | WS_TABSTOP,206,213,116,8
    CONTROL         " Replace LF in file with CR/LF",IDC_CHECK6,"Button",
                    BS_AUTOCHECKBOX | WS_TABSTOP,206,225,114,9
    CONTROL         " Search string CR/LF -> LF",IDC_CHECK7,"Button",
                    BS_AUTOCHECKBOX | WS_TABSTOP,206,238,116,8
END


#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//

VS_VERSION_INFO VERSIONINFO
 FILEVERSION 1,0,0,1
 PRODUCTVERSION 1,0,0,1
 FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
 FILEFLAGS 0x1L
#else
 FILEFLAGS 0x0L
#endif
 FILEOS 0x4L
 FILETYPE 0x1L
 FILESUBTYPE 0x0L
BEGIN
    BLOCK "StringFileInfo"
    BEGIN
        BLOCK "040904B0"
        BEGIN
            VALUE "CompanyName", "\0"
            VALUE "FileDescription", "ScanR MFC Application\0"
            VALUE "FileVersion", "1, 0, 0, 1\0"
            VALUE "InternalName", "ScanR\0"
            VALUE "LegalCopyright", "Copyright (C) 2003\0"
            VALUE "LegalTrademarks", "\0"
            VALUE "OriginalFilename", "ScanR.EXE\0"
            VALUE "ProductName", "ScanR Application\0"
            VALUE "ProductVersion", "1, 0, 0, 1\0"
        END
    END
    BLOCK "VarFileInfo"
    BEGIN
        VALUE "Translation", 0x409, 1200
    END
END

#endif    // !_MAC


/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//

#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE 
BEGIN
    IDD_ABOUTBOX, DIALOG
    BEGIN
        LEFTMARGIN, 7
        RIGHTMARGIN, 228
        TOPMARGIN, 7
        BOTTOMMARGIN, 48
    END

    IDD_SCANR_DIALOG, DIALOG
    BEGIN
        LEFTMARGIN, 7
        RIGHTMARGIN, 328
        TOPMARGIN, 7
        BOTTOMMARGIN, 255
    END
END
#endif    // APSTUDIO_INVOKED


/////////////////////////////////////////////////////////////////////////////
//
// String Table
//

STRINGTABLE DISCARDABLE 
BEGIN
    IDS_ABOUTBOX            "&About ScanR..."
END

#endif    // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////



#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
#define _AFX_NO_SPLITTER_RESOURCES
#define _AFX_NO_OLE_RESOURCES
#define _AFX_NO_TRACKER_RESOURCES
#define _AFX_NO_PROPERTY_RESOURCES

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE 9, 1
#pragma code_page(1252)
#endif //_WIN32
#include "res\ScanR.rc2"  // non-Microsoft Visual C++ edited resources
#include "afxres.rc"         // Standard components
#endif

/////////////////////////////////////////////////////////////////////////////
#endif    // not APSTUDIO_INVOKED

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
United States United States
Kamal Shankar is a programming freak (or so he feels).He currently lives in the Salt Lake City and loves doing what he has been since 1990 - coding horribly Wink | ;)

Comments and Discussions