Guest User

Untitled

a guest
Jul 23rd, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. Login,Name,Surname
  2. Rd-001,Raj,Dolka
  3. RS-932,Ram,Selmen
  4.  
  5. <!DOCTYPE html>
  6. <html>
  7. <head>
  8. <title>reading file</title>
  9. <script type="text/javascript">
  10.  
  11. var reader = new FileReader();
  12.  
  13. function readText(that){
  14.  
  15. if(that.files && that.files[0]){
  16. var reader = new FileReader();
  17. reader.onload = function (e) {
  18. var output=e.target.result;
  19.  
  20.  
  21.  
  22.  
  23. //process text to show only lines with "@":
  24. output=output.split("n").filter(/./.test, /-/).join("n");
  25.  
  26.  
  27. document.getElementById('main').innerHTML= output;
  28. };//end onload()
  29. reader.readAsText(that.files[0]);
  30. }//end if html5 filelist support
  31. }
  32. </script>
  33. </head>
  34. <body>
  35. <input type="file" onchange='readText(this)' />
  36. <div id="main"></div>
  37. </body>
  38. </html>
Add Comment
Please, Sign In to add comment