XLSX

springboot ftp 笔记

不羁岁月 提交于 2020-03-02 03:47:34
private boolean uploadFile() { try { StopWatch watch = new StopWatch(); watch.start(); // 创建一个ftp对象 FTPClient ftp = new FTPClient(); //ftp.setControlEncoding("GBK"); // ftp连接上去 ftp.connect(ftpHost, ftpPort); // ftp登录上去 ftp.login(ftpUsername, ftpPassword); // 拿到返回码,进行判断是否连接成功 Integer reply = ftp.getReplyCode(); // 连接失败 if (!FTPReply.isPositiveCompletion(reply)) { ftp.disconnect(); return false; } // 连接成功,准备上传 ftp.setFileType(FTPClient.BINARY_FILE_TYPE); // 获取时间节点 Date now = new Date(); SimpleDateFormat formatFile = new SimpleDateFormat("yyyy-MM-dd"); String dateName = formatFile.format(now);

给R语言读取Excel表的能力

纵然是瞬间 提交于 2020-02-28 06:11:24
Excel是企业电子表格处理的事实标准格式。R本身都是处理各种文本格式,像是CSV,或者自己的二进制格式文件。让两批人可能够彼此沟通,就必须让R能够读取xlsx格式。 R专门处理Excel文件的包是xlsx。 直接在线安装 > install.packages("xlsx") also installing the dependencies ‘rJava’, ‘xlsxjars’ trying URL 'https://mirrors.tongji.edu.cn/CRAN/bin/windows/contrib/3.6/rJava_0.9-11.zip' Content type 'application/zip' length 832080 bytes (812 KB) downloaded 812 KB trying URL 'https://mirrors.tongji.edu.cn/CRAN/bin/windows/contrib/3.6/xlsxjars_0.6.1.zip' Content type 'application/zip' length 9485571 bytes (9.0 MB) downloaded 9.0 MB trying URL 'https://mirrors.tongji.edu.cn/CRAN/bin/windows/contrib/3.6

云捷Go-免费开源的Go语言开发框架

懵懂的女人 提交于 2020-02-27 15:41:03
框架简介 以前是做Java企业应用开发,想转Go,看了很多优秀的开源项目但是发现没有合适的,一直没找到类似于若依开发思路的快速开发框架。于是狠下心自己写了一套后台系统。这个框架可以用于所有的Web应用程序,如网站管理后台,网站会员中心,CMS,CRM,OA。所有前端后台代码封装过后十分精简易上手,出错概率低。同时支持移动客户端访问。系统会陆续更新一些实用功能。 受之开源,回馈社区,本框架以GoFrame为web服务框架,继续沿用MIT开源协议,架构思路沿袭着若依的以辅助生成重复代码为主,不过度封装,生成的代码可以快速修改适应不同的需求,适应每个开发者自己的习惯和风格。所以命名为"云捷GO"(寓意:GO云原生业务快捷开发) 核心技术及组件 web服务框架 GoFrame v1.11.4 导出excel文件 tealeg/xlsx v1.0.5 api文档生成 swaggo/swag v1.6.5 图形验证码 base64Captcha v1.2.2 服务器监控 gopsutil v2.19.12+incompatible 若依前端组件 RuoYi v4.1.0(做了部分适配GoFrame修改,命名为yf.js,不要跟原项目ry.js混用,文档可以通用) 文档地址:正在编写 http://www.yunjie.info 内置功能 用户管理:用户是系统操作者,该功能主要完成系统用户配置。

内网文件分片上传,断点续传

╄→尐↘猪︶ㄣ 提交于 2020-02-27 10:06:22
之前仿造 uploadify 写了一个HTML5版的文件上传插件,没看过的朋友可以 点此 先看一下~得到了不少朋友的好评,我自己也用在了项目中,不论是用户头像上传,还是各种媒体文件的上传,以及各种个性的业务需求,都能得到满足。小小开心了一把。 但无论插件再怎么灵活,也难以应付所有的需求,比如,你要上传一个2G的文件。以现在我们的网速,恐怕再快也得传半小时。要命的是,如果你在上传到90%的时候不小心关掉了浏览器,或者是手一抖摁了F5,完了,一切还得从头再来。这种用户体验简直太糟糕了。所以,断点续传就十分有必要了。什么是续传我就不解释了,用QQ传文件这么多年,大家都见过了。 这里要说的是断点续传都有哪些技术要点。使用传统的表单提交文件或是HTML5的FormData都是将文件“整块”提交,服务端取到该文件后再进行转移、重命名等操作,因此,无法实时保存文件的已上传部分。而且在http协议下,我们无法保持浏览器与服务端的长连接,不能以文件流的形式来提交。所以要解决的问题具体来讲有以下几点: 对上传的文件进行分割,每次只上传一小片。服务端接收到文件后追加到原来部分,最后合并成完整的文件。 每次上传文件片前先获取已上传的文件大小,确定本次应切割的位置 每次上传完成后更新已上传文件大小的记录 标识客户端和服务端的文件,保证不会把A文件的内容追加到B文件上 在参考了张鑫旭大哥的 这篇文章 后

Element-ui组件库Table表格导出Excel表格

浪尽此生 提交于 2020-02-13 22:26:31
安装 npm install --save xlsx file-saver 两个插件的详细地址在下面 https://github.com/SheetJS/js-xlsx https://github.com/eligrey/FileSaver.js 代码部分(有注释解释说明) <template> <div class="table"> <!--给表格添加一个id,导出文件事件需要使用--> <el-table :data="tableData" border style="width: 100%" id="out-table" > <el-table-column prop="date" label="日期" width="180" > </el-table-column> <el-table-column prop="name" label="姓名" width="180" > </el-table-column> <el-table-column prop="address" label="地址" > </el-table-column> </el-table> <!--给按钮绑定事件--> <button @click="exportExcel">点击导出</button> </div> </template> <script> // 引入导出Excel表格依赖

给R语言读取Excel表的能力

你说的曾经没有我的故事 提交于 2020-02-07 02:04:18
Excel是企业电子表格处理的事实标准格式。R本身都是处理各种文本格式,像是CSV,或者自己的二进制格式文件。让两批人可能够彼此沟通,就必须让R能够读取xlsx格式。 R专门处理Excel文件的包是xlsx。 直接在线安装 > install.packages("xlsx") also installing the dependencies ‘rJava’, ‘xlsxjars’ trying URL 'https://mirrors.tongji.edu.cn/CRAN/bin/windows/contrib/3.6/rJava_0.9-11.zip' Content type 'application/zip' length 832080 bytes (812 KB) downloaded 812 KB trying URL 'https://mirrors.tongji.edu.cn/CRAN/bin/windows/contrib/3.6/xlsxjars_0.6.1.zip' Content type 'application/zip' length 9485571 bytes (9.0 MB) downloaded 9.0 MB trying URL 'https://mirrors.tongji.edu.cn/CRAN/bin/windows/contrib/3.6

R: Append a worksheet to an excel workbook without reading the entire workbook

一曲冷凌霜 提交于 2020-02-05 08:25:12
问题 I have a 26 mb excel workbook to which I am trying to add a 42 kb worksheet. Using the openxlsx package, I have the following code: wb_object <- loadWorkbook(to_name2) addWorksheet(wb_object, "New Data") writeData(wb_object, sheet = "New Data", m_data) saveWorkbook(wb_object, to_name2, overwrite = TRUE) What I have noticed is that this code takes about 2 minutes to execute. I believe R is reading in the entire 26 mb file and then appending the 42 kb worksheet. Is there any way to append the

Download an xlsx file with reactJS: Excel can not open file

僤鯓⒐⒋嵵緔 提交于 2020-01-30 12:15:26
问题 I'm trying to download an xlsx file with reactJS but i'm receiving this message when i try to open my file after download: "Excel can not open file 'file.xlsx' because the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the file format" Here's the frontend code: const REST_DOWNLOAD_URL = REST_URL + '/token'; Rest.ajaxPromise('GET', REST_DOWNLOAD_URL).then(function (res) { var FILE_URL = "/supermarket/token/" + res;

How to read excel from a URL in react js

做~自己de王妃 提交于 2020-01-25 07:24:30
问题 Unable to convert Uint8Array returned data from an excel to string using xlsx-js Sheet JS I am trying to read excel from a SharePoint URL in React JS using xlsx-js (Sheet JS) library. However, the data returned in the object is in the form of Uint8Array and I'm not able to convert it back to string. const XLSX = require('xlsx'); let url = "https://cors-anywhere.herokuapp.com/https://sharepoint.com/URL/SAC1Planning.xlsx"; let req = new XMLHttpRequest(); req.open("GET", url, true); req

How to stop other conditional formatting from disappearing when hackmodding databars into solid fills?

一笑奈何 提交于 2020-01-24 22:53:07
问题 EPPlus has no support for extLst thing which is needed to make databars conditional formatting with solid fill. They are gradient by themselves without modifications. I coded this to modify worksheet's xml directly (this gets databars from worksheet XML and then adds required extLst nodes): public static Random Rnd = new Random(); public static string GenerateXlsId() { //{29BD882A-B741-482B-9067-72CC5D939236} string id = string.Empty; for (int i = 0; i < 32; i++) if (Rnd.NextDouble() < 0.5)