Skip to content

Content copied from Serial Monitor output is formatted text #2093

Open
@IvanchoIotata

Description

@IvanchoIotata

Describe the problem

It is common for Arduino sketches to output serial data to the computer in a delimiter-separated format (AKA "CSV"). This data is usually copied from the Arduino IDE Serial Monitor and then pasted into a spreadsheet program for further manipulation and analysis (e.g., generating charts).

🐛 Content copied from the Serial Monitor output field is stored in the clipboard as formatted text. This causes it to not be correctly recognized as delimiter-separated data when pasting it into a spreadsheet program.

To reproduce

  1. Upload a sketch to your Arduino board that produces delimiter-separated output.
    A demonstration sketch is provided here:
    Content copied from Serial Monitor output is formatted text #2093 (comment)
  2. Open the Arduino IDE Serial Monitor.
  3. Select the output in the Serial Monitor view.
  4. Open a new spreadsheet in your spreadsheet application (e.g., OpenOffice/LibreOffice Calc, Microsoft Excel)
  5. Paste the data from the clipboard to the spreadsheet.

🐛 The data is pasted in a single column:

image

Expected behavior

The format of the content copied from the Serial Monitor output field is in plain text format (i.e., CF_TEXT).

This will allow it to be recognized as delimiter-separated data when pasted into a spreadsheet application. The application will either automatically import the data into the appropriate spreadsheet columns, or else present an import dialog.

Arduino IDE version

8f8b46f

Operating system

Windows, Linux, macOS

Operating system version

This is universal behavior

Additional context

The fault does not occur when the Arduino IDE 1.x Serial Monitor is used.


The problem appears to be related to the Serial Monitor output being printed as HTML, which causes it to be copied to the clipboard as "HTML Format" (CF_HTML) data. More information:

https://learn.microsoft.com/en-us/windows/win32/dataxchg/clipboard-formats


A tab character was arbitrarily chosen for the delimiter in the demo, but the fault also occurs with other delimiters (e.g., comma, semicolon, space).

Additional reports

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: codeRelated to content of the project itselftopic: serial monitorRelated to the Serial Monitortype: imperfectionPerceived defect in any part of project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions