Tag: 文件

使用Java创build和编辑Excel文档(.csv)

对于我正在开发的这个项目,我想采用多个Excel表格,然后将它们合并为一个,根据需要操作数据,使所有内容更具可读性。 什么是打开文件,读取内容,存储内容,创build新文件(.csv),然后将信息粘贴到我select的组织中的最佳方式? 我肯定需要坚持java,因为这将是一个预先存在的自动化过程的一部分,我不想把所有的东西都改成另一种语言。 有一个有用的软件包,我应该知道吗? 非常感谢 瑞斯蒂昂

填充VBA的最佳方式

我有以下电子表格结构。 ID, Storage_name, Name_of_product, Quantity_used, Date_Used 用户给出了开始date和结束date,并且我必须填入这些开始/结束date之间存储器中存在的所有产品的所有数量。 例如 如果结构是 ID Storage_name Name_of_Product Quantity used Date_used 1 st1 pro1 2 11/1/2011 2 st2 pro2 5 11/2/2011 1 st1 pro1 3 11/2/2011 4 st1 pro3 5 11/4/2011 并且用户selectst1作为存储位置,11/01/2011和11/04/2011作为我的输出应该是的开始和结束date ID Storage_name Name_of_Product Quantity used 1 st1 pro1 7 4 st1 pro3 5 我没有使用数据库(我希望是)。 这是做到这一点的最好方法。 我首先从头到尾运行三个循环,其次检查storage_name,第三个检查Name_of_product,然后更新quantity_counter,但变得混乱。 应该有更好的方法来做到这一点。 我正在将输出写入文件。 谢谢PS我知道我不必在输出文件中使用列storage_name。 […]

perl excel到pdf

我正在使用Perl模板来尝试为客户创build发票有点自动化。 我唯一的问题是,我真的很想能够把这个excel文件转换为PDF格式,但我似乎无法find任何types的perl模块。 有没有人听说过这样的事情? 我知道它可以做某事,因为单词和开放式办公室设法做到这一点!

发送ExcelPackage文件给用户

我想在服务器端build立ExcelPackage文件,并发送允许用户下载它。 这是我创build文件的代码: private byte[] ExcelFileCreate() { using (var excelPackage = new ExcelPackage()) { excelPackage.Workbook.Properties.Author = User.Identity.Name; excelPackage.Workbook.Properties.Title = "Skybot"; excelPackage.Workbook.Properties.Company = "Dataminds"; excelPackage.Workbook.Worksheets.Add("Selected unit folder"); var excelWorksheet = excelPackage.Workbook.Worksheets[1]; excelWorksheet.Name = "Selected unit folder"; int rowIndex = 1; int columnIndex = 1; do { var cell = excelWorksheet.Cells[rowIndex, columnIndex]; var fill = cell.Style.Fill; fill.PatternType = […]

在c#中打开并保存excel文档

我试图用C#打开和保存一个Excel文档,但是我总是得到错误:“已经从它的底层RCW分离的COM对象不能被使用”。 在行ExcelApp.Quit(); 我GOOGLE了很多的解决scheme,但没有为我工作到目前为止。 这是我的代码: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using Microsoft.Office.Core; using Excel = Microsoft.Office.Interop.Excel; namespace test_excel { public partial class Form1 : Form { Excel.Application ExcelApp = null; Excel.Workbook ExcelWorkBook = null; Excel.Sheets ExcelSheets = null; Excel.Worksheet MySheet = null; public […]

macros来validation上次修改文件的时间

我已经看到了一些非常相似的问题,但没有一个有我正在寻找的答案。 其中一些没有回答。 我有一个VBAmacros,通过search文件和validation文件的创build时间来validation在某个date(在这里是昨天)中创build的所有文件。 由于macros在互联网上被发现,我不知道这些对象是如何工作的。 我想知道是否有一种方法来改变fill.DateCreated类似的东西,而不是检查文件创builddate时,macros将validation文件被修改时。 起初似乎很简单,但现在我真的很难得到这个。 谁能帮我这个? Sub VerifyNewFiles() Dim n As String, msg As String, d As Date msg = "" Set fso = CreateObject("Scripting.FileSystemObject") Set fils = fso.GetFolder("C:\Users\Desktop\").Files For Each fil In fils n = fil.Name d = fil.DateCreated If d >= Date – 1 Then msg = msg & n & vbTab […]

从variables文件名称中抽取特定单词

这可能很容易对你们很多,但我是新的VBA.I有一个variables名为“Dateiname”的Excel文件,我想通过添加variables“啤酒花”来更新这个“Dateiname”。 我的问题是Dateiname里面已经有了“.xlsm”,我希望“.xlsm”扩展名可以在Dateiname之后去掉,所以我可以把“hops”variables添加到“Dateiname”中,并用“.xlsm”扩展名结束。 Dim hops as String Dim Dateiname as String Dateiname = Dateiname & hops & ".xlsm" 我怎样才能做到这一点 ?

CSV文件创build问题

我正在用python脚本创build一个csv文件,内容如下: def createFile(): logfile = csv.writer(open('logfile.csv', 'wb'), dialect='excel') formater = zip(dates, hours, threadids, loglevels, errorcodes, errormessage) for i in formater: logfile.writerow(i) 而且一切正常,直到我用Excel打开文件,因为它打开了一列中的整个文本。 这是从csv的一行看起来像: 4/29/12,22:44:32:865 EDT,0000004b,A,CHFW0019I,The Transport Channel Service has started chain chain_308. 有没有办法打开文件分割的文件应该如何? 问候。

VBScript:使用Excel中的文件夹结构创build文件

我拼凑了以下VBS文件以读取Excel源文件,并使用基于Excel列A的名称和基于列B(连续)的内容创build文件。 这一切工作… Dim xlsFile Dim objExcel Dim outFile Dim path path = "C:\Documents and Settings\Andy\Desktop\SHORTURLs\JSPs" xlsFile = path & "\urls.xls" Set objExcel = WScript.CreateObject("Excel.Application") objExcel.Workbooks.open(xlsFile) ' Create the File System Object Set objFSO = CreateObject("Scripting.FileSystemObject") intRow = 2 'Row 1 contains headings ' Here is the loop that cycles through the cells Do Until objExcel.Cells(intRow,1).Value […]

比较多行并在R或Excel中创buildmatrix

我有一个文件包含,多行如下 在file1中: a 8|2|3|4 4 b 2|3|5|6|7 5 c 8|5|6|7|9 5 a到a有4个重叠,同样a到b有2个重叠,为了检查各个实体之间的重叠,我需要生成一个具有上述细节的matrix,输出应该是一个matrix abc a 4 2 1 b 2 5 3 c 1 3 5 请给我一个build议,怎么做? 有无论如何这样做使用Excel或使用shell脚本或使用R? 我已经写了下面的代码,但由于我不是一个好的编码器,不能得到打印在正确的格式输出。 setwd('C:\\Users\\Desktop\\') newmet1<-file("file.txt") newmet2<-strsplit(readLines(newmet1),"\t") Newmet<-sapply(newmet2, function(x) x[2:length(x)], simplify=F ) for (i in 1:length(Newmet)) { for (j in 1:length(Newmet) { c <- ((intersect(Newmet[[i]], Newmet[[j]])) print (length(c)) } } 编辑:感谢所有的答案..我得到了马蒂克斯。 […]