spreadsheet

File system crawler - iteration bugs

余生颓废 提交于 2019-12-11 04:16:54
问题 I'm currently building a file system crawler with the following code: require 'find' require 'spreadsheet' Spreadsheet.client_encoding = 'UTF-8' count = 0 Find.find('/Users/Anconia/crawler/') do |file| if file =~ /\b.xls$/ # check if filename ends in desired format contents = Spreadsheet.open(file).worksheets contents.each do |row| if row =~ /regex/ puts file count += 1 end end end end puts "#{count} files were found" And am receiving the following output: 0 files were found The regex is

Regex - Link formatting

偶尔善良 提交于 2019-12-11 03:52:38
问题 I have the following link in excel: http://en.wikipedia.org/wiki/Melon_Bicycles I would like to retrieve the link as: http://en.wikipedia.org In google doc I used: =REGEXEXTRACT(A1; "https?:\/\/(.[^\/]+)") , whereas A1 is the cell with the unformated link. Any recommendation how to implement that in excel 2010? 回答1: A simple approach would be to use LEFT with FIND . Something like this =LEFT(A1,FIND("/",A1,9)) 来源: https://stackoverflow.com/questions/28832479/regex-link-formatting

Default cell values when Inserting new row in Google Sheets

穿精又带淫゛_ 提交于 2019-12-11 03:48:28
问题 In Google Sheets, I would like to "Insert 1 row above/below" and have certain cells in this new row to have default values. For example, when a new row is added, the cell in column C for this row will have the letter "N", column G will have a "Y", and column T will have a formula of "=sum(A2+B2)" - of course the A2 and B2 will need to reflect the number of this new row. What I have so far: function addRow() { var sheet = SpreadsheetApp.getActiveSheet(); var cell = sheet.getActiveCell(); var

Google spreadsheet query execute for entire column

感情迁移 提交于 2019-12-11 03:17:44
问题 I tried VLOOKUP function for two separate Google spreadsheets but it doesn't support, So I figure it out my required function with a QUERY using a ImportRange function. Here it is: =QUERY( ImportRange( "sheet key" , "Course Data!A2:I4" ) , "select Col2 where Col1 = '" & E2 & "' limit 1" ) This is execute well for selected cell, it return value from the second spreadsheet according to the value of the current sheet E2 cell. What I want to achieve is run this query for entire column (E3, E4, E5

Excel Spreadsheet Dynamic cell colouring using XML and XSLT

北城以北 提交于 2019-12-11 02:51:26
问题 I got an XML source file (from other source) and its respective XSL file to get the XML transformed into Excel Spreadsheet. What i need is to dynamically change background color of cell in spreadsheet based on XML attribute for a node using XSL Example: Source.XML content <workbooks> <Wrkbook <table Id="My table 1"> <Colnames> <ColumnName>Student ID</ColumnName> <ColumnName>Student Name</ColumnName> <ColumnName>Subject 1</ColumnName> <ColumnName>Subject 2</ColumnName> <ColumnName>Subject 3<

How to write array to Excel with differing styles per column using Axlsx

a 夏天 提交于 2019-12-11 02:22:39
问题 I would like to be able to use the Axlsx gem to write out an Excel spreadsheet with different styles applied to different columns. I am writing an Array of Hashes an entire row at a time and, as a result, I cannot seem to format the columns differently as needed. I don't know how to say, "for columns A-D use default styling, however for column E and F, use horizontal center alignment". require 'axlsx' p = Axlsx::Package.new wb = p.workbook # Default Style for all cells standard_text = wb

How to rotate cell value in spreadsheetview controlsfx?

别说谁变了你拦得住时间么 提交于 2019-12-11 00:48:34
问题 I tried using the code below //css .spreadsheet-cell.verticalHeader{ -fx-rotate: -90; -fx-background-color: white; } //controller cell = SpreadsheetCellType.STRING.createCell(row, 2, 1,1, "Pin"); cell.getStyleClass().add("verticalHeader"); rows.add(cell); but the output is like this: 回答1: What do you want to do exactly? You are applying a rotation on the cell itself, therefore rotating the whole Node. My advice would be to set a null value in the SpreadsheetCell, and set a Label inside the

How do I remove duplicate values in a cell seperated with a /?

ぃ、小莉子 提交于 2019-12-10 23:40:50
问题 I have multiple cells in excel that have as follows: b1= E4I8/E4I8/E4I8/E4I8 b2=D3B2/B30C1/D3B2/D3B2/D3B2/B30C1 multiple /xxxx/ How do I remove these duplicate text strings in the same cell? Thank you 回答1: This function uses the keys of a dictionary to build a unique list of parts from a passed-in string (add a reference to Microsoft Scripting Runtime ): Public Function UniqueParts(separator As String, toParse As String) As String Dim d As New Scripting.Dictionary, part As Variant, i As

Excel Sheet display in android

蹲街弑〆低调 提交于 2019-12-10 10:34:55
问题 I want to display an excel sheet in my android application. I have googled and yet cannot find a starting tip to render an excel file using android components. If anybody knows any thing please give me some valuable hint. 回答1: You can use Apache POI or Java Excel API. 回答2: In android jxl.jar is use for create excel sheet. and it is available at here and you can create excel sheet by using following code. File root = Environment.getExternalStorageDirectory(); File gpxfile = new File(root,

Google apps script to grab data from webpage

假装没事ソ 提交于 2019-12-10 10:27:25
问题 I had help making this script before that would pull the playercount off a website and log it into spreadsheets with a date and timestamp, this was: function pullRuneScape() { var page = UrlFetchApp.fetch('http://runescape.com/title.ws').getContentText(); var number = page.match(/PlayerCount.*>([0-9,]+)</)[1]; SpreadsheetApp.getActive().getSheetByName('RuneScape').appendRow([new Date(), number]); } Basically in the webpage they list the amount of players and I wanted to log it every 5minutes