Skip to Content

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:

         

Capture.JPG

       5. Use this code to read and write your file:

               View JS:

                         Capture.JPG

               Controller.JS:

                              Capture.JPG

                                   Capture.JPG

                                           

                                                  Capture.JPG

OutPut:

                                           Capture.JPG

For IOS Users: add platform as ios

Thanks,

Karthik A

                                      

                              



To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply