Query Import

Parent Previous Next

Query Import 

EnSight has the ability to read queries from external ASCII text files, but the format of these files are specific to EnSight. Many users have data in standard tabular formatted text files (e.g. CSV files from Excel) and may not be in a position to easily reformat this type of data. This QuickTool is designed to help, it can import data directly from CSV and similarly formatted files It creates EnSight queries from a text, csv, or dat file.

Usage 

Double click the tool and choose a filename. Note there is a convenient file suffix filter for filtering .txt, .csv, or .dat files in the file open dialog. 

Choose the Field delimiter as Comma (default), Tab, Space, Colon, or Semicolon. Decide if you want the importer to Skip whitespace (default off), and specify the Quote character as None(default), Double quote (") or Apostrophe (‘).  

 

 

Click OK to read the file using your options, and to display the file in table format, and then pick the Query Title, Query X Title, Query Y Title, Query X Data, Query Y Data, and then click on the + to create the query from your choices. 


Example 

Suppose you have a CSV text file with the following text: 

Query 1 

time, query 1 

0.0 , 0.0 

1.0 , 1.2 

2.0, 2.4 

3.0, 7.3 

Query 2 

time, query 2 

0.0, 0.0 

1.0 , 1.5 

2.0, 3.0 

3.0, 5.5 

 

Import this with the default options, to see the following table: 

 

You will select the various entities and then either click on the corresponding icon (tool tips will tell you what it does), or you can see the options in the File menu. 

 

And the process is to select the cell(s), click on the icon.  For example, Select cell 1,1 and Click on the red T (tool tip shows Set query title), to define the query title. 

 

 

Note the Red T appears in the cell 1,1.  

Now, select the x title (cell 2,1, containing 'time'), click on the blue XT icon

. 

 

 

 

Now Select the y title, click on the grey YT icon.

   

 

Now Select the x data, click on the yellow XD icon.

  

Now Select the y data, click on the green YD icon.

  

Click on the green + to create a new EnSight Query. 

 

 

Now you can plot the query within EnSight by right-clicking on it and choosing to add to plot. 

 

Resulting in an EnSight plotter with the imported query:

 

Notes

There is no requirement that the cells be in columns. Any rectangle of cells can be selected and they will be read as a vector, going row by row over all of the columns. In the case of the title strings, all of the text in all of the tagged cells will be concatenated and used as the title, so if a title crosses multiple columns, simply tag all of the necessary cells. Cells themselves can also be edited in the spreadsheet by clicking on them and entering new text.

The green “+” button is used to actually import the tagged data into EnSight as a new query. The tagged selections in the dialog are then reset and another query may be imported from the same file if desired. If a selection of cells is tagged with a tag that has already used, all original tags of that type are removed before the new cells are tagged. The red “x” button can also be used to reset all of the current tags.