This following code sample will guide you on how to convert a tab delimited text file to JSON format, with the following JSON file structure, using of Python programming.

First, let create a text file with tab delimited as following:

Save the file as employee.txt

Now, create a .py file with the following python code:

Save the file as

To execute, run it using the python command as following:

A new json file called emp.json should be created now with the following content.

Download sample source code: