Quantcast
Channel: SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 789

Read and Write TXT File from Android, IOS

$
0
0

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

                                      

 

 

 

                              

 

 




Viewing all articles
Browse latest Browse all 789

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>