How to Convert Two Dimensional Files to a Flat File

Flat files format database records into plain text files, which can be referenced by a website or application for its data. Because of the plain text formatting, flat files are ideal for tabular, or "two-dimensional," databases. The tabular data can be arranged into parent rows and children. If you have a two-dimensional table that you'd like to convert into a flat file, Microsoft's Visual Studio integrated development environment (IDE), along with the BizTalk Server Developer package, enables you to generate flat files from your data. Other software will also allow you to perform the task.

Instructions

  1. Visual Studio

    • 1

      Launch Visual Studio. Select the "New Project" option from the "Files" heading. Select the "Windows Forms Application" option when the "New Project" window pops up.

    • 2

      Right-click on the new project's entry in the "Solution Explorer" window. Highlight the "Add" option in the context menu that appears, and then click on the "New Item" option.

    • 3

      Select the "Schema File" option form in the "Add New Item" menu's "Categories" menu box. Select "Flat Schema File." Type the name of your document, along with its file extension, into the "Name" field in the menu and then click on the "Add" button.

    • 4

      Browse for your source file from the "Flat File Schema Information" menu -- click on the "Browse" button. Select a "UTF-8" encoding from the "Code Page" menu box. Type an output name for your file into the "Target Namespace" menu box and then click on the "Next" button.

    • 5

      Highlight the tabular data that you wish to include in your flat file, when the "Select Document Data" menu appears. Click on the menu's "Next" button to continue.

    • 6

      Define the elements of your data, using the "Child Elements" window. Type each of your data's headers into the "Element" name fields in the menu. Click on the adjacent "Element Type" menu boxes, and select the option that defines the element -- for example, you can label an element as a "Record" or a "Field." Set each element's data type, using the adjacent "Data Type" menu boxes.

    • 7

      Click on the first element of the "Schema View" menu. Highlight all of the data in the your document that pertains to the first element. Select any of the desired formatting options, and then click "Next" to return to the Schema View menu and work on the next element.

    • 8

      Click "Next," and then continue on to the end of the wizard to generate your flat file.

    XMLconvert

    • 9

      Download a free copy of XMLconvert to convert your tabular files into flat files (see Resources). Extract the XMLconvert fold from its ZIP container. Right-click on the compressed file, and then select the "Extract All" option from the context menu that appears. Click on the "Extract" button when the extraction menu appears.

    • 10

      Download and install a free copy of JAVA's JDK package (see Resources). Configure JAVA's class path. Start by clicking on the "Start" button in your taskbar. Type "System Variables" into the Start menu's search box, and then click on the "System Variables" icon when it appears in the menu.

    • 11

      Click on the "Environment Variables" button in the menu that appears. Click on the "Path" variable in the "Environment Variables" menu, and then click on the "Edit" button. Type "C:\Java\jdk1.7.0\bin;C:\Windows\System32\;C:\Windows\;C:\Windows\System32\Wbem" into the "Variable" field, and then click "OK." Close the "System Variables" menu.

    • 12

      Return to the "Start" menu and then type "cmd" into its search box. Click on the "cmd" icon when it appears in the Start menu.

    • 13

      Invoke XMLconvert's XML2flat utility to convert your database by typing "xml2flat "destination name"_dtd.xfl "xml file name"_dtd.xml "text file name"_dtd.txt" in the Command Prompt window. Substitute "destination name" with the desired name for your output file. Substitute "xml file name" with the name of your source XML file. Substitute "text file name" with the name of the XML file's accompanying text file.

    • 14

      Hit the "Enter" key on your keyboard enter your data and generate your flat file.

    Flat File Generator

    • 15

      Download a free copy of Flat File Generator to convert your tabular databases to flat file manaully (see Resources). Launch the program after you've installed it.

    • 16

      Click on the field beneath the "Field" header to type in the first header in your table. New fields will be generated after you file the preceding field. Click on each of the adjacent "Data" fields to enter the data associated with each header.

    • 17

      Select the desired type of delimter, or data separator, from the list of options beneath the program's "Delimiter" heading.

    • 18

      Click on the "Generate" file button to create a flat file from your data.

Related Searches:

References

Resources

Comments

Related Ads

Featured