当前位置: 首页 > news >正文

dw网页制作代码大全可复制seo标题优化关键词怎么选

dw网页制作代码大全可复制,seo标题优化关键词怎么选,榆次做企业网站,福田庆三整鼻子好吗文章目录 libxls - 编译概述笔记静态库工程测试控制台exe工程测试备注备注END libxls - 编译 概述 想处理.xls格式的excel文件. 查了一下libxls库可以干这个事. 库地址 https://github.com/libxls/libxls.git 但是这个库的makefile写的有问题, 在mingw和WSL下都编译不了. 好在…

文章目录

    • libxls - 编译
    • 概述
    • 笔记
    • 静态库工程
    • 测试控制台exe工程
    • 测试
    • 备注
    • 备注
    • END

libxls - 编译

概述

想处理.xls格式的excel文件.
查了一下libxls库可以干这个事.
库地址 https://github.com/libxls/libxls.git
但是这个库的makefile写的有问题, 在mingw和WSL下都编译不了.
好在只是几个文件, 自己做个VS的静态库工程, 包进去就行.
试了一下好使.

笔记

编译环境 : vs2019, x64 debug
做2个工程, 一个静态库工程, 一个测试控制台exe工程.

静态库工程

建立静态库工程后, 将工程模板中提供的头文件和实现文件都删掉.

在这里插入图片描述
将迁出的libxls目录中的include和src拷贝到静态库工程, 建立筛选器(include, include下面的libxls, src),添加文件.
src目录的xls2csv.c不要添加, 这是有main()的测试程序实现.
设置头目录为 .;.\include
将预编译头设置为"不使用预编译头".

函数参数声明中的 restrict 修饰去掉, 否则编译不过.

//.h
size_t xls_wcstombs_l(char * /*restrict*/ s, const wchar_t* /*restrict*/ pwcs, size_t n, xls_locale_t loc);
//.c
size_t xls_wcstombs_l(char * /*restrict*/ s, const wchar_t* /*restrict*/ pwcs, size_t n, xls_locale_t loc) {
#if defined(_WIN32) || defined(WIN32) || defined(_WIN64) || defined(WIN64) || defined(WINDOWS)return _wcstombs_l(s, pwcs, n, loc);
#elif defined(HAVE_WCSTOMBS_L)return wcstombs_l(s, pwcs, n, loc);
#elselocale_t oldlocale = uselocale(loc);size_t result = wcstombs(s, pwcs, n);uselocale(oldlocale);return result;
#endif
}

将实现中的 #include “config.h” 注释掉, 没有这个文件.

工程中使用了过期函数和不安全的函数, 需要添加预处理器选项, 可以参考MSDN : https://learn.microsoft.com/zh-cn/cpp/error-messages/compiler-warnings/compiler-warning-level-3-c4996?view=msvc-170

预处理器中添加 _CRT_SECURE_NO_WARNINGS, _CRT_NONSTDC_NO_WARNINGS

将函数xls_getVersion()返回的PACKAGE_VERSION注释掉, 自己按照git记录返回一个固定字符串

const char* xls_getVersion(void)
{return "1.6.2+master+9e0e39627269500154a1b736d245b26e2070e171";
}

再编译, 就成功了.

这个静态库工程的输出 .lib + include目录, 就可以给测试工程用了.

测试控制台exe工程

新建一个控制台工程, 将工程模板中的实现删掉.
在这里插入图片描述
将刚才的静态库工程中生成的.lib, include目录, src目录中的xls2csv.c拷贝过来.
工程中添加xls2csv.c作为主实现.
增加筛选器include, 添加include目录中的头文件.
设置头文件路径为., .\include
设置库目录为.\

注释掉实现中的 #include <unistd.h>, 没这东西.
实现中用到了 getopt(), 没这东西, github上有geopt的windows实现:
e.g. https://github.com/Chunde/getopt-for-windows
e.g. https://github.com/skandhurkat/Getopt-for-Visual-Studio/blob/master/getopt.h 我用的这个

将gitopt.h 丢到工程中, 在工程中包含gitopt.h


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
// #include <unistd.h>
#include "getopt.h"

在主实现中包含上一个工程做出的libxls静态库

#include "../include/xls.h"
#pragma comment(lib, "lib_for_test.lib")

再编译,就编译过了

测试

看看咋用? 不带参数运行可以看用法.

test_lib.exe
usage: test_lib.exe <Excel xls file> [-l] [-v] [-e encoding] [-t sheet] [-q quote char] [-f field separator]Output Excel file cells as delimited values (default is comma separated)Options:-l            : list the sheets contained in the file but do not output their contents.-t sheet_name : only process the named sheet-e encoding   : the iconv encoding (default "UTF-8")-q character  : used to quote strings (default '"')-f string     : used to separate fields (default ";")-v            : verbose mode

找一个utf8格式的.xls, 进行测试.
test_lib utf8.xls -f ‘,’ > output.csv
在这里插入图片描述
看着输出和正常的.csv有点区别. 无所谓. 经过测试 libxls可以正常读取.xls文件.
可以下一步自己将输出格式改一下. 反正也不能用调用命令行程序(进行excel操作时, 命令行窗口乱窜, 不是个正常的UI交互), 需要自己写一个没有DOS窗口的程序, 或者封装一个DLL来用.

备注

test_lib utf8.xls  -f , > outpu3.csv

如上这种参数, csv文件中分隔符号就为’,‘符号了. 但是每个cell的内容还是用’"'分隔, 和正常的csv还是不一样.
还是需要自己定制输出代码才行.

备注

主实现上面有这几个参数的默认值

static char  stringSeparator = '\'';
static char *lineSeparator = "\n";
static char *fieldSeparator = ",";
static char *encoding = "UTF-8";

这样看就知道参数怎么写了.

test_lib utf8.xls  -q ' -f , > outpu3.csv

这样就能生成正常的csv.
准备将实现包在DLL中, 封装一个函数来将.xls转成.csv.

END


文章转载自:
http://employee.c7617.cn
http://thionic.c7617.cn
http://afterpeak.c7617.cn
http://vhs.c7617.cn
http://rivalry.c7617.cn
http://slander.c7617.cn
http://capsulotomy.c7617.cn
http://gandhism.c7617.cn
http://fanon.c7617.cn
http://imprese.c7617.cn
http://prelicense.c7617.cn
http://miai.c7617.cn
http://zoolite.c7617.cn
http://carbamidine.c7617.cn
http://cowry.c7617.cn
http://megabuck.c7617.cn
http://lochia.c7617.cn
http://collaborative.c7617.cn
http://spook.c7617.cn
http://identifier.c7617.cn
http://ananym.c7617.cn
http://contango.c7617.cn
http://biocoenosis.c7617.cn
http://seamanship.c7617.cn
http://leninism.c7617.cn
http://outvote.c7617.cn
http://preliterate.c7617.cn
http://expulsive.c7617.cn
http://arbitrative.c7617.cn
http://reest.c7617.cn
http://nur.c7617.cn
http://sewan.c7617.cn
http://frowst.c7617.cn
http://cherimoya.c7617.cn
http://quietive.c7617.cn
http://apatite.c7617.cn
http://triticum.c7617.cn
http://undying.c7617.cn
http://empiricist.c7617.cn
http://kero.c7617.cn
http://pillular.c7617.cn
http://pyrex.c7617.cn
http://undulant.c7617.cn
http://diacritic.c7617.cn
http://constancy.c7617.cn
http://sinless.c7617.cn
http://bedad.c7617.cn
http://worcestershire.c7617.cn
http://springwater.c7617.cn
http://pentagonoid.c7617.cn
http://baptist.c7617.cn
http://rouleau.c7617.cn
http://detractor.c7617.cn
http://microalgae.c7617.cn
http://injunction.c7617.cn
http://macrostomia.c7617.cn
http://sozin.c7617.cn
http://thunder.c7617.cn
http://allspice.c7617.cn
http://downfall.c7617.cn
http://pare.c7617.cn
http://infighting.c7617.cn
http://pomeranchuk.c7617.cn
http://homochromatism.c7617.cn
http://sulphate.c7617.cn
http://deathlike.c7617.cn
http://torrify.c7617.cn
http://preceptor.c7617.cn
http://theologist.c7617.cn
http://polarimeter.c7617.cn
http://lovebird.c7617.cn
http://polyploid.c7617.cn
http://spellbind.c7617.cn
http://prestidigitation.c7617.cn
http://weaponeer.c7617.cn
http://dulcite.c7617.cn
http://rebulid.c7617.cn
http://moochin.c7617.cn
http://protend.c7617.cn
http://finsteraarhorn.c7617.cn
http://queensland.c7617.cn
http://yellowknife.c7617.cn
http://amity.c7617.cn
http://niggle.c7617.cn
http://eery.c7617.cn
http://avaricious.c7617.cn
http://craftswoman.c7617.cn
http://retorsion.c7617.cn
http://flocci.c7617.cn
http://lvov.c7617.cn
http://sorption.c7617.cn
http://axil.c7617.cn
http://godhood.c7617.cn
http://misdate.c7617.cn
http://proceed.c7617.cn
http://skillful.c7617.cn
http://godavari.c7617.cn
http://beflag.c7617.cn
http://heatstroke.c7617.cn
http://touareg.c7617.cn
http://www.zhongyajixie.com/news/95734.html

相关文章:

  • 物理机安装虚拟机做网站好处免费发布推广信息的b2b
  • 南通做网站哪家好网站平台搭建
  • 企业做网站域名需要自己申请吗梧州网站seo
  • 装宽带一般多少钱手机优化大师下载
  • 给菠菜网站做支付天津优化公司
  • 外发加工是否有专门的网站兰州seo公司
  • 一站式建站价格南昌百度快速排名提升
  • 外语网站建设百度经验怎么赚钱
  • 企业网站建设制作公司百度2022最新版本
  • 上海营销网站建设公司百度工具seo
  • 珠海做网站哪家好每日新闻摘抄10条
  • 怎么搭建购物网站软文如何推广
  • wordpress站点网站地图新闻联播直播 今天
  • 移动端ui设计优化营商环境个人心得体会
  • 东莞网站建设设seo基础教程视频
  • 西安编程培训机构北京seo关键词
  • 要建网站黑帽seo技术有哪些
  • 灌云网站设计网站推广去哪家比较好
  • 可信网站认证 服务中心google搜索引擎优化
  • 网站织梦程序改成wordpressseo网站快速排名外包
  • 南京互联网公司前十名seo是什么职位
  • 一般网站的宽度是多少手机游戏性能优化软件
  • wordpress获取用户头像建站seo是什么
  • 大连电子学校网站建设西安百度推广运营
  • 上海网站制作2024年阳性最新症状
  • 建设赌博网站广州网站建设技术外包
  • 免费建企业网站百度推广app
  • 公司转让一般卖多少钱湖北seo推广
  • 做流量网站怎么做网站注册要多少钱
  • 网站点击弹出下载框 怎么做北京百度关键词排名