39 open source Excel catalyst wave -json explain the string of super library

General VBA development groups, the processing json, xml data source structure in the world's VB6, is a very difficult thing, vaguely remember where to find their own interpretation of a json function implemented using a dictionary, it is very rare.
In the .Net world, which has become so simple and easy to use herein, this ordinary .Net development, it may be very stale old knowledge, VBA developers can hope for a little inspiration.

38 in an open wave code, a large number of json interpreted code, which uses the name Ding Ding Newtonsoft.Json library.

Downloads billions of dollars on nuget, do keyword searches are routed to the front

Since most of the catalyst using Excel scene as data collection, the collected data json data conversion, the data becomes a standard table structure for the database and the structured Excel users.

So just use function-based queries without the need for generating json data (json data generation is very simple sequence of what you can).

Data query in SQL is a relational database is king in the .Net world, of course, linq. So the json query, it becomes no different from the experience and linqtoxml (strongly recommended learning linq knowledge and learning linqtoxml incidentally, input-output ratio is very high, a lot of scenes can be used).

Good library, learning materials and a large number of documents, Newtonsoft.Json is no exception, with its grungy look at the code Excel catalyst, it is better to take the time to see a sample document library written by the author.

Partial query-based, you can look linqtojson theme

Newtonsoft.Json will become similar json access the same access to xml flowing freely, are available through linq.

Of course, the idea of ​​object-oriented programming, more direct json is directly converted to a class object instance, the direct use LinqToObject can be accessed, also a code, you can deserialize the json character instance of an object .

With instantiation, you can have a strongly typed intelligent display function code, from code to write more general feeling of flying.

Deserialization process

Speaking of anti-serialization, it certainly has serialization code is twelve kinds of things, can easily be serialized to json profile information stored locally.

Things serialization code is twelve

Of course, there are some fine-tuning small details, such as the original return date formats are not satisfied, you can use the following code to control it.

            var timeConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
            string str = JsonConvert.SerializeObject(result, Formatting.Indented,timeConverter);

同样地如果json字符串要求序列化的结果为C#关键字时,可以用JsonProperty这样处理它

    class PostData
    {
        public string api_name { get; set; }
        public string token { get; set; }
        //params为C#关键字不能用
        [JsonProperty(PropertyName = "params")]
        public Dictionary<string, string> Params { get; set; }
        public string fields { get; set; }

    }

在Newtonsoft.Json的世界,json和xml是兄弟,是左右手,随时想转换都同样只需一句代码即可,所以Excel催化剂实现功能过程中,也懒得对xml字符串进行表格化转换了,实在xml见到的机会越来越少了,实在有,直接转成json,再作处理就好。

xml and json system conversion is very easy to do

xml有xpath的查询,在json的世界,也有jsonPath,语法很接近于xpath,学这些通用性知识,很容易类比到其他同类的知识上,学习回报很不错,同样推崇的当然还有正则,那是后话。

jsonPath inquiry

And then on a jsonPath query can also be fuzzy search

对jsonPath感兴趣的,可以在这个网站上学习。https://goessner.net/articles/JsonPath/

jsonPath and compare xpath

结语

作为数据分析工作者的业余开发,不能对开发的细节面面俱到,仅将自己开发Excel催化剂过程中,会遇到的一些细节,给大家一同分享,希望对大家有所帮助。

技术交流QQ群

QQ群名:Excel催化剂开源讨论群, QQ群号:788145319
Excel catalyst dimensional code open source discussion groups

关于Excel催化剂

Excel催化剂先是一微信公众号的名称,后来顺其名称,正式推出了Excel插件,插件将持续性地更新,更新的周期视本人的时间而定争取一周能够上线一个大功能模块。Excel催化剂插件承诺个人用户永久性免费使用!

Excel催化剂插件使用最新的布署技术,实现一次安装,日后所有更新自动更新完成,无需重复关注更新动态,手动下载安装包重新安装,只需一次安装即可随时保持最新版本!

Excel催化剂插件下载链接:https://pan.baidu.com/s/1Iz2_NZJ8v7C9eqhNjdnP3Q

Contact the author

No public

取名催化剂,因Excel本身的强大,并非所有人能够立马享受到,大部分人还是在被Excel软件所虐的阶段,就是头脑里很清晰想达到的效果,而且高手们也已经实现出来,就是自己怎么弄都弄不出来,或者更糟的是还不知道Excel能够做什么而停留在不断地重复、机械、手工地在做着数据,耗费着无数的青春年华岁月。所以催生了是否可以作为一种媒介,让广大的Excel用户们可以瞬间点燃Excel的爆点,无需苦苦地挣扎地没日没夜的技巧学习、高级复杂函数的烧脑,最终走向了从入门到放弃的道路。

最后Excel功能强大,其实还需树立一个观点,不是所有事情都要交给Excel去完成,也不是所有事情Excel都是十分胜任的,外面的世界仍然是一个广阔的世界,Excel只是其中一枚耀眼的明星,还有其他更多同样精彩强大的技术、工具等。*Excel催化剂也将借力这些其他技术,让Excel能够发挥更强大的爆发!

关于Excel催化剂作者

姓名:李伟坚,从事数据分析工作多年(BI方向),一名同样在路上的学习者。
服务过行业:零售特别是鞋服类的零售行业,电商(淘宝、天猫、京东、唯品会)

技术路线从一名普通用户,通过Excel软件的学习,从此走向数据世界,非科班IT专业人士。
历经重重难关,终于在数据的道路上达到技术平原期,学习众多的知识不再太吃力,同时也形成了自己的一套数据解决方案(数据采集、数据加工清洗、数据多维建模、数据报表展示等)。

擅长技术领域:Excel等Office家族软件、VBA&VSTO的二次开发、Sqlserver数据库技术、Sqlserver的商业智能BI技术、Powerbi技术、云服务器布署技术等等。

2018 began his career made a major adjustment, from the original full-time job, turned freelance, no fixed income, temporarily on the road ahead is not clear, bitter return to full-time job, for Excel catalyst operations and development must be greatly affected (within the time could not maintain full-time job can not just put the results in a work published in time, the time outside of work is very limited, because he has thirty years of age, family responsibility).

And the majority of advocates with expectations: Excel catalyst has been able to run down, I have the benefit of the group were able to support ( multi-message encouragement, friend circle under forwarded the recommendation under small a reward and the most focused and where the company can and recommended recommended peers, so I can maximize the value of technology in your company to achieve a win-win (you can imagine how the data is preliminary consultant or small projects to develop forms of cooperation).

Guess you like

Origin www.cnblogs.com/ExcelCuiHuaJi/p/11225059.html