Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

146
Views
How to read first line from csv file and display in textbox | Oracle Apex | JavaScript

I have created a application in ORACLE APEX

Where I have file browser , textbox and submit. when I select the file its first line should be read and displayed in textbox on click of submit button

<!DOCTYPE html>
<html>
<body>

<p>Choose file:</p>
  <input type="file" id="myFile" name="filename">
  <input type="submit"> 
  <br><br>
  <label for="fname">First line from csv file :</label>
  <input type="text" id="fname" name="fname">
  
</body>
</html>

My Js code

function confirmFileSubmit(){
    var input  = document.getElementById('fileUpload'); // get the input
    var file   = input.files[0];                  // assuming single file, no multiple
    var reader = new FileReader();

    reader.onload = function(e) {
        var text = reader.result;                 // the entire file

        var firstLine = text.split('\n').shift(); // first line 

        console.log(firstLine);                   // use the console for debugging
    }

    reader.readAsText(file, 'UTF-8');             // or whatever encoding you're using
                                                  // UTF-8 is default, so this argument 
}   
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!