Skip to content

Minimal Text File Schema Definition Tutorial

This tutorial will show you how to build a Text File Schema Definition that will contain the absolute minimum of information required to define and validate the Tutorial Text File successfully.

Tutorial Text File

last_name,first_name,state,zip_code,price,date,notes
Craig,Kai,OK,73755,15499,12/26/2019,"friendly, prompt and good tipper"
Wilcox,Jack,,,12458,7/14/2017,very nice
O'Neil,Kasper,WY,82937,15499,3/7/2011,paid by certified check
Marks,Sopoline,CT,06778,4859,8/21/2014,"never paid, do not do any further business"
Kelly,Colorado,,,9899,6/3/2018,

Steps To Build The Minimal Text File Schema Definition

  1. Open a copy of the Text File Schema Definition template file in a text editor
    1. https://textfileschema.omegatower.net/schemas/tfsd_template.tfsd
    2. Save it with a new file name
    3. Don't forget to save it frequently and often as you build the Text File Schema Definition
  2. Update the Control Record, using its definition as a guide
    1. Set the SchemaEnclosureCharacter to "22"
      Of the allowed characters for this field, the QUOTATION MARK, which has 22hex for its Unicode code point, has been chosen to be used in the Schema Definition for this tutorial.
  3. Update the Meta Record, using its definition as a guide, to match the Text File
    1. Set ID to "2".
      It's the second record in the Schema Definition, so this is a logical choice for the ID.
    2. Set FileType to "DELIMITED"
      It can be seen that a COMMA character is being used to delimit the fields in the tutorial Text File, so this field is set to match.
    3. Set DelimiterCharacter to "2C"
      It can be seen that a COMMA, which has 2Chex for its Unicode code point, is being used to delimit the fields in the tutorial Text File, so this field is set to its hexadecimal value.
    4. Set EnclosureCharacter to "22"
      It can be seen that a QUOTATION MARK, which has 22hex for its Unicode code point, is being used to enclose fields in the tutorial Text File that contain the DelimiterCharacter, so this field is set to its hexadecimal value.
    5. Set EncloseWhen to "NEEDED"
      It can be seen that a QUOTATION MARK character is ONLY being used to enclose fields in the tutorial Text File that contain the DelimiterCharacter, so this field is set to match.
    6. Set CharacterEncoding to "UTF-8"
      Set this field to match the character encoding of the tutorial Text File.
    7. Set EndOfLine to "NEWLINE"
      Set this field to match how the tutorial Text File handles identifying a new line. If you can't easily figure this out, using "NEWLINE" is often a good place to start.
    8. Set FieldIDByHeaderOrPosition to "HEADER"
      It is clear that the data fields are identified by a header row, so this field is set to match.
  4. Duplicate the Record Record below the existing Record Record, so that you now have two of them in your Text File Schema Definition file, one after the other
  5. Update the first Record Record, using its definition as a guide, to match the header record of the Text File
    1. Set ID to "3"
      It's the third record in the Schema Definition, so this is a logical choice for the ID.
    2. Set Position to "1"
      It's the first record belonging to its parent record: the Meta Record.
    3. Set ParentID to "2"
      The ID of its parent record, the Meta Record, goes here.
    4. Set Required to "YES"
      The Text File will always have a header record, so this field is set to match.
    5. Set HasData to "ALWAYS"
      The Text File header record will always contain data, so this field is set to match.
    6. Set MinimumAllowed to "1"
      The fewest number of header records in the Text File is one, so this field is set to match.
    7. Set MaximumAllowed to "1"
      The most number of header records in the Text File is one, so this field is set to match.
    8. Set RecordRow to "1"
      The header record appears in the first row of the Text File, so this field is set to match.
    9. Set IsHeader to "YES"
      This record is the header record, so this field is set to match.
    10. Set TrailingDelimiter to "NO"
      It can be seen that there are no COMMA characters after the final header field in the tutorial Text File, so this field is set to match.
  6. Update the second Record Record, using its definition as a guide, to match the data records of the Text File
    1. Set ID to "4"
      It's the fourth record in the Schema Definition, so this is a logical choice for the ID.
    2. Set Position to "2"
      It's the second record belonging to its parent record: the Meta Record.
    3. Set ParentID to "2"
      The ID of its parent record, the Meta Record, goes here.
    4. Set Required to "YES"
      For the purposes of this tutorial, the Text File will always have at least one data record, so this field is set to match.
    5. Set HasData to "ALWAYS"
      The Text File data record will always contain data, so this field is set to match.
    6. Set MinimumAllowed to "1"
      The fewest number of data records in the Text File is one, so this field is set to match.
    7. Set IsHeader to "NO"
      This record is NOT the header record, so this field is set to match.
    8. Set TrailingDelimiter to "NO"
      It can be seen that there are no COMMA characters after the final data fields in the tutorial Text File, so this field is set to match.
  7. Duplicate the Field Record below the existing Field Record, so that you now have 14 of them in your Text File Schema Definition file, one after the other. These will be seven for the header record and seven for the data record.
  8. Update the first Field Record, using its definition as a guide, to match the first field of the header record of the Text File
    1. Set ID to "5"
      It's the fifth record in the Schema Definition, so this is a logical choice for the ID.
    2. Set Position to "1"
      It's the first record belonging to its parent record: the first Record Record.
    3. Set ParentID to "3"
      The ID of its parent record, the first Record Record, goes here.
    4. Set Required to "YES"
      For the purposes of this tutorial, the Text File will always have all header fields, so this field is set to match.
    5. Set HasData to "ALWAYS"
      Header fields always have data, so this field is set to match.
    6. Set DataType to "STRING"
      Header fields always have textual data, so this field is set to match.
  9. Update the second Field Record, using its definition as a guide, to match the second field of the header record of the Text File
    1. Set ID to "6"
      It's the sixth record in the Schema Definition, so this is a logical choice for the ID.
    2. Set Position to "2"
      It's the second record belonging to its parent record: the first Record Record.
    3. Set ParentID to "3"
      The ID of its parent record, the first Record Record, goes here.
    4. Set Required to "YES"
      For the purposes of this tutorial, the Text File will always have all header fields, so this field is set to match.
    5. Set HasData to "ALWAYS"
      Header fields always have data, so this field is set to match.
    6. Set DataType to "STRING"
      Header fields always have textual data, so this field is set to match.
  10. Update the third Field Record, using its definition as a guide, to match the third field of the header record of the Text File
    1. Set ID to "7"
      It's the seventh record in the Schema Definition, so this is a logical choice for the ID.
    2. Set Position to "3"
      It's the third record belonging to its parent record: the first Record Record.
    3. Set ParentID to "3"
      The ID of its parent record, the first Record Record, goes here.
    4. Set Required to "YES"
      For the purposes of this tutorial, the Text File will always have all header fields, so this field is set to match.
    5. Set HasData to "ALWAYS"
      Header fields always have data, so this field is set to match.
    6. Set DataType to "STRING"
      Header fields always have textual data, so this field is set to match.
  11. Update the fourth Field Record, using its definition as a guide, to match the fourth field of the header record of the Text File
    1. Set ID to "8"
      It's the eighth record in the Schema Definition, so this is a logical choice for the ID.
    2. Set Position to "4"
      It's the fourth record belonging to its parent record: the first Record Record.
    3. Set ParentID to "3"
      The ID of its parent record, the first Record Record, goes here.
    4. Set Required to "YES"
      For the purposes of this tutorial, the Text File will always have all header fields, so this field is set to match.
    5. Set HasData to "ALWAYS"
      Header fields always have data, so this field is set to match.
    6. Set DataType to "STRING"
      Header fields always have textual data, so this field is set to match.
  12. Update the fifth Field Record, using its definition as a guide, to match the fifth field of the header record of the Text File
    1. Set ID to "9"
      It's the ninth record in the Schema Definition, so this is a logical choice for the ID.
    2. Set Position to "5"
      It's the fifth record belonging to its parent record: the first Record Record.
    3. Set ParentID to "3"
      The ID of its parent record, the first Record Record, goes here.
    4. Set Required to "YES"
      For the purposes of this tutorial, the Text File will always have all header fields, so this field is set to match.
    5. Set HasData to "ALWAYS"
      Header fields always have data, so this field is set to match.
    6. Set DataType to "STRING"
      Header fields always have textual data, so this field is set to match.
  13. Update the sixth Field Record, using its definition as a guide, to match the sixth field of the header record of the Text File
    1. Set ID to "10"
      It's the tenth record in the Schema Definition, so this is a logical choice for the ID.
    2. Set Position to "6"
      It's the sixth record belonging to its parent record: the first Record Record.
    3. Set ParentID to "3"
      The ID of its parent record, the first Record Record, goes here.
    4. Set Required to "YES"
      For the purposes of this tutorial, the Text File will always have all header fields, so this field is set to match.
    5. Set HasData to "ALWAYS"
      Header fields always have data, so this field is set to match.
    6. Set DataType to "STRING"
      Header fields always have textual data, so this field is set to match.
  14. Update the seventh Field Record, using its definition as a guide, to match the seventh field of the header record of the Text File
    1. Set ID to "11"
      It's the eleventh record in the Schema Definition, so this is a logical choice for the ID.
    2. Set Position to "7"
      It's the seventh record belonging to its parent record: the first Record Record.
    3. Set ParentID to "3"
      The ID of its parent record, the first Record Record, goes here.
    4. Set Required to "YES"
      For the purposes of this tutorial, the Text File will always have all header fields, so this field is set to match.
    5. Set HasData to "ALWAYS"
      Header fields always have data, so this field is set to match.
    6. Set DataType to "STRING"
      Header fields always have textual data, so this field is set to match.
  15. Update the eighth Field Record, using its definition as a guide, to match the first field of the data record of the Text File
    1. Set ID to "12"
      It's the twelfth record in the Schema Definition, so this is a logical choice for the ID.
    2. Set Position to "1"
      It's the first record belonging to its parent record: the second Record Record.
    3. Set ParentID to "4"
      The ID of its parent record, the second Record Record, goes here.
    4. Set Required to "YES"
      For the purposes of this tutorial, the Text File will always have all data fields, so this field is set to match.
    5. Set HasData to "ALWAYS"
      It can be seen that this field always has data in the Text File, as well as that this makes "sense" to the purposes of the text File, so this field is set to match.
    6. Set DataType to "STRING"
      It can be seen that this data field contains textual data in the tutorial Text File, so this field is set to match.
  16. Update the ninth Field Record, using its definition as a guide, to match the second field of the data record of the Text File
    1. Set ID to "13"
      It's the thirteenth record in the Schema Definition, so this is a logical choice for the ID.
    2. Set Position to "2"
      It's the second record belonging to its parent record: the second Record Record.
    3. Set ParentID to "4"
      The ID of its parent record, the second Record Record, goes here.
    4. Set Required to "YES"
      For the purposes of this tutorial, the Text File will always have all data fields, so this field is set to match.
    5. Set HasData to "ALWAYS"
      It can be seen that this field always has data in the Text File, as well as that this makes "sense" to the purposes of the text File, so this field is set to match.
    6. Set DataType to "STRING"
      It can be seen that this data field contains textual data in the tutorial Text File, so this field is set to match.
  17. Update the tenth Field Record, using its definition as a guide, to match the third field of the data record of the Text File
    1. Set ID to "14"
      It's the fourteenth record in the Schema Definition, so this is a logical choice for the ID.
    2. Set Position to "3"
      It's the third record belonging to its parent record: the second Record Record.
    3. Set ParentID to "4"
      The ID of its parent record, the second Record Record, goes here.
    4. Set Required to "YES"
      For the purposes of this tutorial, the Text File will always have all data fields, so this field is set to match.
    5. Set HasData to "OPTIONAL"
      It can be seen that this field does not have data in all the Text File data records,so this field is set to match.
    6. Set DataType to "STRING"
      It can be seen that this data field contains textual data in the tutorial Text File, so this field is set to match.
  18. Update the 11th Field Record, using its definition as a guide, to match the fourth field of the data record of the Text File
    1. Set ID to "15"
      It's the fifteenth record in the Schema Definition, so this is a logical choice for the ID.
    2. Set Position to "4"
      It's the fourth record belonging to its parent record: the second Record Record.
    3. Set ParentID to "4"
      The ID of its parent record, the second Record Record, goes here.
    4. Set Required to "YES"
      For the purposes of this tutorial, the Text File will always have all data fields, so this field is set to match.
    5. Set HasData to "OPTIONAL"
      It can be seen that this field does not have data in all the Text File data records,so this field is set to match.
    6. Set DataType to "STRING"
      It can be seen that this data field contains textual data in the tutorial Text File, so this field is set to match.
  19. Update the 12th Field Record, using its definition as a guide, to match the fifth field of the data record of the Text File
    1. Set ID to "16"
      It's the sixteenth record in the Schema Definition, so this is a logical choice for the ID.
    2. Set Position to "5"
      It's the fifth record belonging to its parent record: the second Record Record.
    3. Set ParentID to "4"
      The ID of its parent record, the second Record Record, goes here.
    4. Set Required to "YES"
      For the purposes of this tutorial, the Text File will always have all data fields, so this field is set to match.
    5. Set HasData to "ALWAYS"
      It can be seen that this field always has data in the Text File, as well as that this makes "sense" to the purposes of the text File, so this field is set to match.
    6. Set DataType to "NUMBER"
      It can be seen that this data field contains numeric data in the tutorial Text File, so this field is set to match.
  20. Update the 13th Field Record, using its definition as a guide, to match the sixth field of the data record of the Text File
    1. Set ID to "17"
      It's the seventeenth record in the Schema Definition, so this is a logical choice for the ID.
    2. Set Position to "6"
      It's the sixth record belonging to its parent record: the second Record Record.
    3. Set ParentID to "4"
      The ID of its parent record, the second Record Record, goes here.
    4. Set Required to "YES"
      For the purposes of this tutorial, the Text File will always have all data fields, so this field is set to match.
    5. Set HasData to "ALWAYS"
      It can be seen that this field always has data in the Text File, as well as that this makes "sense" to the purposes of the text File, so this field is set to match.
    6. Set DataType to "DATE TIME"
      It can be seen that this data field contains date data in the tutorial Text File, so this field is set to match.
    7. Set DateTimeFormat to "M/d/yyyy"
      Set this field to match how the tutorial Text File is storing date data.
  21. Update the 14th Field Record, using its definition as a guide, to match the seventh field of the data record of the Text File
    1. Set ID to "18"
      It's the eighteenth record in the Schema Definition, so this is a logical choice for the ID.
    2. Set Position to "7"
      It's the seventh record belonging to its parent record: the second Record Record.
    3. Set ParentID to "4"
      The ID of its parent record, the second Record Record, goes here.
    4. Set Required to "YES"
      For the purposes of this tutorial, the Text File will always have all data fields, so this field is set to match.
    5. Set HasData to "OPTIONAL"
      It can be seen that this field does not have data in all the Text File data records,so this field is set to match.
    6. Set DataType to "STRING"
      It can be seen that this data field contains textual data in the tutorial Text File, so this field is set to match.
  22. Delete the List Record since it is not used for this tutorial
  23. Delete the Value Record since it is not used for this tutorial
  24. Delete the Condition Record since it is not used for this tutorial
  25. Delete the Rule Record since it is not used for this tutorial
  26. Update the Summary Record, using its definition as a guide
    1. Set ID to "19"
      It's the nineteenth record in the Schema Definition, so this is a logical choice for the ID.
    2. Set ControlCount to "1"
      There is one Control Record in the new Schema Definition.
    3. Set MetaCount to "1"
      There is one Meta Record in the new Schema Definition.
    4. Set RecordCount to "2"
      There are two Record Records in the new Schema Definition.
    5. Set FieldCount to "14"
      There are fourteen Field Records in the new Schema Definition.
    6. Set ListCount to "0"
      There are no List Records in the new Schema Definition.
    7. Set ValueCount to "0"
      There are no Value Records in the new Schema Definition.
    8. Set ConditionCount to "0"
      There are no Condition Records in the new Schema Definition.
    9. Set RuleCount to "0"
      There are no Rule Records in the new Schema Definition.
    10. Set SummaryCount to "1"
      There is one Summary Record in the new Schema Definition.
    11. Set TotalCount to "19"
      There are nineteen total records in the new Schema Definition.

Built Minimal Text File Schema Definition

Type=CONTROL,ID=1,SchemaEnclosureCharacter=22,Version=1.0.1.22,,,,,,,,,,,,,,,,,
Type=META,ID=2,Name=,Annotation=,Version=,FileType=DELIMITED,DelimiterCharacter=2C,EnclosureCharacter=22,EncloseWhen=NEEDED,CharacterEncoding=UTF-8,EndOfLine=NEWLINE,FieldIDByHeaderOrPosition=HEADER,SchemaURL=,OwnerName=,OwnerEmail=,OwnerPhone=,,,,,
Type=RECORD,ID=3,Name=,Annotation=,Position=1,ParentID=2,Required=YES,HasData=ALWAYS,MinimumAllowed=1,MaximumAllowed=1,KeyField=,ParentKeyField=,RecordIDPosition=,RecordIDValue=,RecordRow=,Width=,IsHeader=YES,TrailingDelimiter=NO,,,
Type=RECORD,ID=4,Name=,Annotation=,Position=2,ParentID=2,Required=YES,HasData=ALWAYS,MinimumAllowed=1,MaximumAllowed=,KeyField=,ParentKeyField=,RecordIDPosition=,RecordIDValue=,RecordRow=,Width=,IsHeader=NO,TrailingDelimiter=NO,,,
Type=FIELD,ID=5,Name=,Annotation=,Position=1,ParentID=3,Required=YES,HasData=ALWAYS,MinimumLength=,MaximumLength=,DataType=STRING,DateTimeFormat=,ListID=,StringRegex=,NumericMinimumValue=,NumericMaximumValue=,Start=,Width=,Alignment=,FillCharacter=,Sample=
Type=FIELD,ID=6,Name=,Annotation=,Position=2,ParentID=3,Required=YES,HasData=ALWAYS,MinimumLength=,MaximumLength=,DataType=STRING,DateTimeFormat=,ListID=,StringRegex=,NumericMinimumValue=,NumericMaximumValue=,Start=,Width=,Alignment=,FillCharacter=,Sample=
Type=FIELD,ID=7,Name=,Annotation=,Position=3,ParentID=3,Required=YES,HasData=ALWAYS,MinimumLength=,MaximumLength=,DataType=STRING,DateTimeFormat=,ListID=,StringRegex=,NumericMinimumValue=,NumericMaximumValue=,Start=,Width=,Alignment=,FillCharacter=,Sample=
Type=FIELD,ID=8,Name=,Annotation=,Position=4,ParentID=3,Required=YES,HasData=ALWAYS,MinimumLength=,MaximumLength=,DataType=STRING,DateTimeFormat=,ListID=,StringRegex=,NumericMinimumValue=,NumericMaximumValue=,Start=,Width=,Alignment=,FillCharacter=,Sample=
Type=FIELD,ID=9,Name=,Annotation=,Position=5,ParentID=3,Required=YES,HasData=ALWAYS,MinimumLength=,MaximumLength=,DataType=STRING,DateTimeFormat=,ListID=,StringRegex=,NumericMinimumValue=,NumericMaximumValue=,Start=,Width=,Alignment=,FillCharacter=,Sample=
Type=FIELD,ID=10,Name=,Annotation=,Position=6,ParentID=3,Required=YES,HasData=ALWAYS,MinimumLength=,MaximumLength=,DataType=STRING,DateTimeFormat=,ListID=,StringRegex=,NumericMinimumValue=,NumericMaximumValue=,Start=,Width=,Alignment=,FillCharacter=,Sample=
Type=FIELD,ID=11,Name=,Annotation=,Position=7,ParentID=3,Required=YES,HasData=ALWAYS,MinimumLength=,MaximumLength=,DataType=STRING,DateTimeFormat=,ListID=,StringRegex=,NumericMinimumValue=,NumericMaximumValue=,Start=,Width=,Alignment=,FillCharacter=,Sample=
Type=FIELD,ID=12,Name=,Annotation=,Position=1,ParentID=4,Required=YES,HasData=ALWAYS,MinimumLength=,MaximumLength=,DataType=STRING,DateTimeFormat=,ListID=,StringRegex=,NumericMinimumValue=,NumericMaximumValue=,Start=,Width=,Alignment=,FillCharacter=,Sample=
Type=FIELD,ID=13,Name=,Annotation=,Position=2,ParentID=4,Required=YES,HasData=ALWAYS,MinimumLength=,MaximumLength=,DataType=STRING,DateTimeFormat=,ListID=,StringRegex=,NumericMinimumValue=,NumericMaximumValue=,Start=,Width=,Alignment=,FillCharacter=,Sample=
Type=FIELD,ID=14,Name=,Annotation=,Position=3,ParentID=4,Required=YES,HasData=OPTIONAL,MinimumLength=,MaximumLength=,DataType=STRING,DateTimeFormat=,ListID=,StringRegex=,NumericMinimumValue=,NumericMaximumValue=,Start=,Width=,Alignment=,FillCharacter=,Sample=
Type=FIELD,ID=15,Name=,Annotation=,Position=4,ParentID=4,Required=YES,HasData=OPTIONAL,MinimumLength=,MaximumLength=,DataType=STRING,DateTimeFormat=,ListID=,StringRegex=,NumericMinimumValue=,NumericMaximumValue=,Start=,Width=,Alignment=,FillCharacter=,Sample=
Type=FIELD,ID=16,Name=,Annotation=,Position=5,ParentID=4,Required=YES,HasData=ALWAYS,MinimumLength=,MaximumLength=,DataType=NUMBER,DateTimeFormat=,ListID=,StringRegex=,NumericMinimumValue=,NumericMaximumValue=,Start=,Width=,Alignment=,FillCharacter=,Sample=
Type=FIELD,ID=17,Name=,Annotation=,Position=6,ParentID=4,Required=YES,HasData=ALWAYS,MinimumLength=,MaximumLength=,DataType=DATE TIME,DateTimeFormat=M/d/yyyy,ListID=,StringRegex=,NumericMinimumValue=,NumericMaximumValue=,Start=,Width=,Alignment=,FillCharacter=,Sample=
Type=FIELD,ID=18,Name=,Annotation=,Position=7,ParentID=4,Required=YES,HasData=OPTIONAL,MinimumLength=,MaximumLength=,DataType=STRING,DateTimeFormat=,ListID=,StringRegex=,NumericMinimumValue=,NumericMaximumValue=,Start=,Width=,Alignment=,FillCharacter=,Sample=
Type=SUMMARY,ID=19,ControlCount=1,MetaCount=1,RecordCount=2,FieldCount=14,ListCount=0,ValueCount=0,ConditionCount=0,RuleCount=0,SummaryCount=1,TotalCount=19,,,,,,,,,
Back to top