使用java脚本将xlsx文件转换为csv文件的代码。 [英] Code to convert xlsx file to csv file using java script.

查看:257
本文介绍了使用java脚本将xlsx文件转换为csv文件的代码。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经附上了下面的html代码。在点击货币转换按钮时,已选择的xlsx文件应转换为csv文件。这应该显示在另一页上。请帮我解决这个问题。



我尝试了什么:



I have attached the html code below.In that on clicking "currency conversion" button the 'xlsx' file which has been selected should convert into 'csv' file. That should be displayed on another page.Please help me to solve this.

What I have tried:

<?DOCTYPE html>
<html>
<head>

<script language="JavaScript" type="text/javascript">
function HandleBrowseClick()
{
    var fileinput = document.getElementById("browse");
    fileinput.click();
}
function Handlechange()
{
var fileinput = document.getElementById("browse");
var textinput = document.getElementById("filename");
textinput.value = fileinput.value;
}
</script>

<style>
table {
    border: 1px solid black;
	bg-color:BLUE;
	
}
</style>
</head>
 <body>
 
 <!--<form name="Form" onsubmit="return validateForm()" method="post">-->
<center>
 <table>
  <tr><td bgcolor="skyblue"> 
      Input file Path::</td>
	
	     <td > <textarea row="3" cols="50" id="filename"  readonly="true"/> 
		  </textarea><td></tr></br>
		  
<tr><td bgcolor="skyblue">  Browse Input File::</td>
	        <td bgcolor="yellow">
	          <input type="file" id="browse" name="fileupload" style="display: none"  onchange="Handlechange();"/>

<input type="button" value="BROWSE FILE"  onclick="HandleBrowseClick();"/>
			   
			   
			    </td></tr></br>
	<tr><td bgcolor="skyblue">Load Input File Data::</td>
	        <td bgcolor="yellow">
	           <input type="submit" value="CURRENCY CONVERSION">
			   
			    </td></tr>	
<tr><td bgcolor="skyblue">Extract CSV files From Input File::</td>
	        <td bgcolor="yellow">
	           <input type="submit" value="VENDOR SUBSIDIARY CSV">
			   
			   
			    </td></tr>					




</table>


</center>

<!--</form>-->

 </body>

</html>

推荐答案

我用google搜索阅读xlsx文件javascript这是第一次结果



json - 如何在Javascript / HTML5中解析Excel文件 - Stack Overflow [ ^ ]
I googled "read xlsx file javascript" and this was the first result

json - How to parse Excel file in Javascript/HTML5 - Stack Overflow[^]


这篇关于使用java脚本将xlsx文件转换为csv文件的代码。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆