Copy and Paste

Copy and Paste is one of the fastest ways to get data into DataGraph. The data you paste in is handled differently depending what you select in the DataGraph file.

New File

In this example, we will paste data into a new file.

To create a new file, click the ‘New File’ button on the Example files window (bottom right), or select File > New (⌘-N).

Try with the following data table. Click and drag to select the data, then select Edit> Copy (⌘-C) in the menu of your browser. That will place the data in your clipboard.

CountyPopulation
Asia4,298,723,000
Africa1,110,635,000
Europe742,452,000
North America565,265,000
South America406,740,000
Australia38,304,000
Antarctica4,490

In a new DataGraph file, select Edit > Paste or control-click on the data table and select Paste (-V).

Two columns are created, the column headers are automatically entered, and the data type is properly assigned.

The icon on the left of the column object indicates the data type. In this case, the ‘Country’ column is imported as text and the ‘Population’ is a number.

To make the columns wider, hover the cursor over the dividing line between the columns. Click and drag to change the width.

After increasing the column width, the data looks as follows. Note that the comma separators for the thousands place were removed when we pasted the data.

To display the comma separators, click the left corner of the column object for the ‘Population’ column (disclosure triangle) to expand the object. Change the Display menu to ‘#,###’.

Existing Files

When you paste into an existing file, you have three options:

  • Paste over columns – select one or more columns before pasting. If a column header is detected in the new data, the existing column headers are replaced.
  • Paste over rows – select one or more rows before pasting. The existing column headers are not changed, even if the new data has column headers.
  • Paste into new columns – make sure no rows or columns are selected then paste as described for a new file.

Paste over columns

To try this out, open the example files (File > On-line examples) and open the Line Plot example file (Basic section). This file contains data on the vapor pressure of mercury.

Copy the following data to the clipboard.

xy
56.6
109.5
1512.2
2016.7

To paste over the existing data, click the header for the first column to select. Next, hold the shift key while clicking the second column. This will highlight both columns.

Then, use Edit > Paste (⌘-V). This replaces the data and the headers. It also updates the graphs that are using the data, as demonstrated in the following video.

Paste over rows

Instead of selecting columns, this example shows what happens when you select rows.

To try this out, use the same file and copy the example data as above. Next, click anywhere in the data table to select a row. To select all the rows, you can use Edit > Select all (⌘-A).

With all the rows selected, the table will look as follows. Notice how the column headers are not highlighted, compared to the example above.

When you paste in the data (Edit > Paste or ⌘-V), the program will show you a pop-up to confirm the location of each column you are pasting.

Confirm Destination of copied data

Click Import to confirm. The data is replaced but the column headers do not change.

Paste new columns

If you want to paste data from the clipboard into new columns, make sure to deselect existing columns/rows.

To deselect columns/rows, click with the mouse pointer away from the table. For example, you can click on the data list as shown below.

When you paste, DataGraph will import the data from the clipboard into new columns.

Related Articles