I suggest you read the JMP Automation Reference and look up Text Import. Below is an excerpt and a portion of a VB automation example for Text Import.
I find JSL easier to use, so you might want to look up how to run JSL within your C script.
ColumnNamesStart(StartLine as Integer)
Specifies the starting line for column headers. This implies that the file has column headers, so a
positive value here obviates the need for a call to FirstLineIsData(False). The line that contains
column names must come before the first line of data.
DataStarts(StartLine As Integer)
Specifies the starting line for the row data. If the number specified is 1, than it is implied that there
are no column headers. A call to FirstLineIsData(True) is not necessary in this particular case.
FirstLineIsData(Flag As Boolean)
Indicates if the first line of the text file should be interpreted as data or as column headers. True
means data, False means header.
OpenFile() As Document
Opens the text file, using the options specified in the preceding methods. A Document object
pointer is returned. To retrieve a object pointer to the underlying data table, use the GetDataTable
method on the document object.
Private Sub TestEOF_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles TestEOF.Click
TI1 = MyJMP.CreateTextImportObject(InstallDir & "\Samples\Import Data\EOF_space.TXT", 5)
' Set columns 1 and 3 as having type "Character"
' The default is "Numeric"
TI1.SetColumnType(1, JMP.colDataTypeConstants.dtTypeCharacter)
TI1.SetColumnType(3, JMP.colDataTypeConstants.dtTypeCharacter)
'Set space as the only end-of-field option
TI1.SetEndOfFieldOptions(JMP.jmpTIEndOfFieldConstants.tiSpace)
'Set carriage return line feed as the end-of-line delimeter
TI1.SetEndOfLineOptions(JMP.jmpTIEndOfLineConstants.tiCRLF)
TI1.FirstLineIsData(True)
'Open the file
Doc1 = TI1.OpenFile
'Name the document window
Doc1.Name = "SPACE"
'Now open two more files. TI2 gets a file with spaces as
'end-of-field delimeters, TI3 gets one with commas.
TI2 = MyJMP.CreateTextImportObject(InstallDir & "\Samples\Import Data\EOF_spaces.TXT", 5)
TI2.SetColumnType(1, JMP.colDataTypeConstants.dtTypeCharacter)
TI2.SetColumnType(3, JMP.colDataTypeConstants.dtTypeCharacter)
TI2.SetEndOfFieldOptions(JMP.jmpTIEndOfFieldConstants.tiSpaces)
TI2.SetEndOfLineOptions(JMP.jmpTIEndOfLineConstants.tiCRLF)
TI2.FirstLineIsData(True)
Doc2 = TI2.OpenFile
Doc2.Name = "SPACES"
TI3 = MyJMP.CreateTextImportObject(InstallDir & "\Samples\Import Data\EOF_comma.TXT", 5)
TI3.SetColumnType(1, JMP.colDataTypeConstants.dtTypeCharacter)
TI3.SetColumnType(3, JMP.colDataTypeConstants.dtTypeCharacter)
TI3.SetEndOfFieldOptions((JMP.jmpTIEndOfFieldConstants.tiComma))
TI3.SetEndOfLineOptions((JMP.jmpTIEndOfLineConstants.tiCRLF))
TI3.FirstLineIsData((True))
Doc3 = TI3.OpenFile
Doc3.Name = "COMMA"
End Sub