• <Helps for GetStart>
  • CSPro User's Guide
    • The CSPro System
    • Data Dictionary Module
    • The CSPro Language
    • Data Entry Module
    • Batch Editing Applications
    • Tabulation Applications
    • CSPro Statements and Functions
      • Statement Format Symbols
      • Alphabetical List of Functions and Statements
      • List of Reserved Words
      • Deprecated Features
      • Declaration Statements
      • Array Object
      • Audio Object
      • Barcode
      • File Object
      • Freq Object
      • HashMap Object
      • List Object
      • Map Object
      • Path
        • Path Namespace
        • Path.Concat Function
        • Path.GetDirectoryName Function
        • Path.GetExtension Function
        • Path.GetFileName Function
        • Path.GetFileNameWithoutExtension 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
    • Appendix
  • <Helps for CSEntry>
  • <Helps for CSBatch>
  • <Helps for CSTab>
  • <Helps for DataViewer>
  • <Helps for TextView>
  • <Helps for TblView>
  • <Helps for TRSWin>
  • <Helps for CSDeploy>
  • <Helps for CSPack>
  • <Helps for CSFreq>
  • <Helps for CSSort>
  • <Helps for CSExport>
  • <Helps for CSReFmt>
  • <Helps for CSDiff>
  • <Helps for CSConcat>
  • <Helps for TRSSetup>
  • <Helps for ParadataViewer>
  • <Helps for ParadataConcat>
  • <Helps for CSIndex>
  • <Helps for Excel2CSPro>
  • <Helps for 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_path = "C:\CSPro Data Files\Region 1\COVID-19 Survey.csdb";

string data_directory = path.getDirectoryName(data_path);
// result: C:\CSPro Data Files\Region 1\

string data_filename = path.getFilename(data_path);
// result: COVID-19 Survey.csdb

string data_extension = path.getExtension(data_path);
// result: .csdb

string data_filename_without_extension = path.getFilenameWithoutExtension(data_path);
// result: COVID-19 Survey
See also: Path Namespace, Path.GetFileName Function, Path.GetExtension Function