• <GetStart>
  • CSPro User's Guide
    • The CSPro System
    • Data Dictionary Module
    • The CSPro Language
    • Data Entry Module
    • Batch Editing Applications
    • Tabulation Applications
    • Data Sources
    • CSPro Statements and Functions
      • Statement Format Symbols
      • Alphabetical List of Functions and Statements
      • List of Reserved Words
      • Deprecated Features
      • Declaration Statements
      • Symbol Functions
      • Item Functions
      • Array Object
      • Audio Object
      • Barcode and QR Codes
      • Case Object
      • Document Object
      • File Object
      • Freq Object
      • Geometry Object
      • HashMap Object
      • Image Object
      • List Object
      • Map Object
      • Path
        • Path Namespace
        • Path.concat Function
        • Path.getDirectoryName Function
        • Path.getExtension Function
        • Path.getFileName Function
        • Path.getFileNameWithoutExtension Function
        • Path.getRelativePath Function
        • Path.selectFile Function
      • Pff Object
      • SystemApp Object
      • ValueSet Object
      • Program Control Statements
      • Assignment Statements
      • Data Entry Statements and Functions
      • Batch Edit Statements
      • Numeric Functions
      • String Functions
      • Multiple Occurrence Functions
      • General Functions
      • Date and Time Functions
      • External File Functions
      • Synchronization Functions
    • Templated Reporting System
    • HTML and JavaScript Integration
    • Action Invoker
    • Appendix
  • <CSEntry>
  • <CSBatch>
  • <CSTab>
  • <DataViewer>
  • <TextView>
  • <TblView>
  • <CSFreq>
  • <CSDeploy>
  • <CSPack>
  • <CSDiff>
  • <CSConcat>
  • <Excel2CSPro>
  • <CSExport>
  • <CSIndex>
  • <CSReFmt>
  • <CSSort>
  • <ParadataConcat>
  • <ParadataViewer>
  • <CSCode>
  • <CSDocument>
  • <CSView>
  • <CSWeb>

Path.getFileNameWithoutExtension Function

Format
s = Path.getFileNameWithoutExtension(path_string);
Description
The Path.getFileNameWithoutExtension function returns the file name for the path specified in the string expression path_string. The file name will not include the extension of the file; to get the file name with the extension, use the Path.getFileName function.
Return Value
The function returns a string with the directory name and extension removed from the full path.
Example
string data_directory = "C:\CSPro Data Files";

string survey_data_path = Path.concat(data_directory, "Region 1", "COVID-19 Survey.csdb");
// result: C:\CSPro Data Files\Region 1\COVID-19 Survey.csdb

string region_data_directory = Path.getDirectoryName(survey_data_path);
// result: C:\CSPro Data Files\Region 1\

string survey_data_filename = Path.getFileName(survey_data_path);
// result: COVID-19 Survey.csdb

string survey_data_extension = Path.getExtension(survey_data_path);
// result: .csdb

string survey_data_filename_without_extension = Path.getFileNameWithoutExtension(survey_data_path);
// result: COVID-19 Survey

string survey_data_path_relative_to_data_directory = Path.getRelativePath(data_directory, survey_data_path);
// result: Region 1\COVID-19 Survey.csdb
See also: Path Namespace, Path.getFileName Function, Path.getExtension Function