Hello dear, want to become our member. Register now by 👉 Clicking here Login!

CSV File Viewer Tool Script Using HTML, CSS, JS - TOOLBOX

Please wait 0 seconds...
Scroll Down and click on Go to Link for destination
Congrats! Link is Generated

Hello guys, welcome to MS Designes. I am Mandeep Singh, Today, I will discuss about how to create CSV File Previewer using HTML, CSS, JS in blogger & wordpress websites

I will provide simple and short script. It is very easy to install in any platform.

Note that, please give credit to Mandeep Singh where you install this script

This tool is developed & designed by Mandeep Singh

The HTML code is here below I merge CSS & JS in single HTML code. Just copy and paste it where you want to display your tool.

Double click on the code to copy it

Live Demo
   

  

  <!DOCTYPE html>

<html>

  <head>

    <meta charset="UTF-8">

    <title>CSV to Text Converter</title>

    <style>

        body {

  font-family: Arial, sans-serif;

  margin: 0;

  padding: 0;

}

h1 {

  font-size: 24px;

  font-weight: bold;

  text-align: center;

  margin: 20px 0;

}

input[type="file"] {

  display: block;

  margin: 20px auto;

}

button {

  display: block;

  margin: 0 auto;

  padding: 10px 20px;

  font-size: 16px;

  font-weight: bold;

  background-color: #0099ff;

  color: white;

  border: none;

  border-radius: 5px;

  cursor: pointer;

}

pre {

  font-size: 16px;

  white-space: pre-wrap;

  word-wrap: break-word;

  background-color: #f5f5f5;

  padding: 20px;

  margin: 20px auto;

  border: 1px solid #ccc;

  border-radius: 5px;

  max-width: 800px;

  overflow-x: auto;

}

    .overlay-credit{text-align:center;margin-top:20px;z-index:9;position:absolute;bottom:6px;right:15px;font-size:10px}  

    </style>

    <script>

      function convertCsvToText() {

        // Get the CSV file input element and read its contents

        const csvFile = document.getElementById('csv-file').files[0];

        const reader = new FileReader();

        reader.readAsText(csvFile);

        reader.onload = function() {

          const csvText = reader.result;

          

          // Split the CSV text into rows and convert to plain text format

          const rows = csvText.split('\n');

          let plainText = '';

          rows.forEach(function(row) {

            const columns = row.split(',');

            columns.forEach(function(column) {

              plainText += column.trim() + '\t';

            });

            plainText += '\n';

          });

          

          // Set the converted text as the output

          document.getElementById('text-output').textContent = plainText;

        };

      }

    </script>

  </head>

  

  <body>

    <h1>CSV to Text Converter</h1>

    <input type="file" id="csv-file">

    

    <button onclick="convertCsvToText()">Convert</button>

    <pre id="text-output"></pre>

     <span>Coded by - &#9829; Mandeep Singh</span>

  </body>

</html>

  

  
CSV Viewer.html 2.02kb

About the Author

Hi, I 'm Mandeep Singh. I 'm a web developer & designer. I provide premium quality website designes.

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.