简单问题文件选择/excel [英] simple questions files selection/excel
问题描述
我是f#的新手.我想执行以下操作:
I am new to f#. I would like to do the following:
1.从目录中选择一个文件,最新创建的* .cvs文件
1. select a file from a directory , the latest created *.cvs file
2.抓取文件内容并在excel中显示所有数据
2. grab the file content and display all the data in excel
到目前为止,我在命令性/功能性方面有些零碎,但是我想看看f#程序员的工作方式
So far I have piece and bits in imperative/functional but I would like to see how an f# programmer
将解决这个简单的问题.
would tackle this simple problem.
非常感谢您
沃尔特
推荐答案
对于第1部分,我愿意
For part 1, I'd do
open System
open System.IO
let here = new DirectoryInfo( ... )
let now = DateTime.UtcNow
let latestCsv = here.EnumerateFiles("*.csv") |> Seq.sortBy (fun x -> now - x.LastWriteTimeUtc) |> Seq.head
我没有以编程方式驱动Excel进行任何操作,但是快速搜索显示了一些配方,这些配方主要涉及在工作簿对象上设置很多属性,而这并不是您真正可以简化的事情.
I've not done anything with driving Excel programatically, but a quick search shows recipes that mainly involve setting a lot of properties on a workbook object, which isn't something that you can really simplify.
这篇关于简单问题文件选择/excel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!