Hi All,
Introduction:
One of my project requirement is to generate json format file by giving input as a txt file.
For ex:
Input File.txt:
-Raman – ECE
-Sita – CSE
-Hanuman-IT
-Ravanan-Mech
Year Should be input Field
OurPut.txt should be:
{“Name”: “Raman”, “Dept” : “ECE”, “Year” : “Final Year”},
{“Name”: “Sita“, “Dept” : “CSE“, “Year” : “Final Year“},
{“Name”: “Hanuman“, “Dept” : “IT“, “Year” : “Final Year“},
{“Name”: “Ravanan“, “Dept” : “Mech“, “Year” : “Final Year”}
Environment: Android, IOS
Solution:
5. Use this code to read and write your file:
View JS:
Controller.JS:
OutPut:
For IOS Users: add platform as ios
Thanks,
Karthik A