Home
About
Search
Welcome to M-Files Empower – our new support experience. We'd love to hear what you think!Give feedback
Home/Support and troubleshooting/Examples and how to

When exporting view/search results on the client to a CSV, an apostrophe is added in front of some fields

Last updated on 15 May 2025

Admin
Views

Overview

When an export is performed from an M-Files client (see Exporting search results) an apostrophe (') character is added to some fields such as phone numbers, negative numbers, web addresses.

Description

M-Files escapes certain characters to avoid potential security risks associated with them and malicious data that can be present. Such data can come from user input, external data sources or it can be imported otherwise into the metadata of the objects.

If the metadata field value begins with one of the following symbols (patterns), the CSV export from the client will escape it with an apostrophe:

  • Minus sign (-)
  • Plus sign (+)
  • Equals sign (=)
  • At symbol (@)
  • http
  • www
  • ftp

Solution

Option 1: Edit the resulting data

If those characters are a problem for your usage scenario (for example, you actually want to let Excel execute formulas, navigate to addresses or calculate numbers), you need to remove the apostrophe character from the exported CSV file manually.

You can do this through the find-and-replace commands

  • In a tool like Microsoft Excel
    Find and replace apostrophe combinations in Excel

Figure 1: Find and Replace apostrophe pattern in Excel

  • in a text processing application (such as Notepad or Notepad++)
    Find and replace apostrophe patterns in Notepad++ in the CSV file

Figure 2: Find and Replace another pattern in Notepad++

Note that you need to be careful when mass replacing data (Replace All) to ensure that you do not alter other information in the document.

Option 2: Change the behavior

As of the September 2022 (22.9) release, a configuration setting controls whether this escaping should occur in the Classic Desktop client. This security relaxation is not available in the New Desktop and New Web clients.

Note that disabling the escaping means that the vault administrator understands and accepts the risks.

The setting is under Configuration > Client > Desktop > Listing > Exporting. Set the "Prevent CSV Injections in Exported Values" setting to "No" to disable the escaping.

A screenshot of a computer     Description automatically generated

Still need help?