我有一个单独的工作表Sheet1和Sheet2,我试图引用从Sheet2到Sheet1的一系列单元格
我知道如何引用工作表单元格,=Sheet2!A1 但是如何对单元格区域执行相同的操作,例如A1:F1我尝试=Sheet2!A1:F1但不喜欢语法.
如果可能的话,我需要使用Excel公式.
我的文件
包含笔记本电脑和库存表的工作簿1,库存将从仅占用笔记本电脑名称的笔记本电脑中获取数据.
目的
从笔记本电脑中提取产品名称(10,000个条目),例如Compaq CQ58-250SA
计划
我们只需要产品名称,因此找到某些关键字(计算机规格)并将其左侧的所有内容(产品名称)
目标关键字
电子表格数据
Cell A1 = Compaq CQ58-250SA Celeron B830,Windows
电池A2 = HP 650奔腾B980,15.6 HD AG LED SVA,
单元A3 =华硕X401A-WX321H,B815,Windows 8
Cell A4 = Compaq CQ58-256SA E1-1200,Windows 8 64
Cell A5 = ASUS,X401A-WX089V,B820,Windows 7
到目前为止我做了什么:
= LEFT(笔记本电脑!A1,FIND( "赛扬",笔记本电脑!A1)-1)
我需要做什么
= LEFT(笔记本电脑!A1,FIND( "赛扬" 和 "奔腾" 和"B815,笔记本电脑!A1)-1)
在我下面的表格中,我抓取了第 1-4 项并将它们存储在一个名为标题的变量中。
我还想选择值 1-4 并将它们存储在一个名为 columns 的变量中,无论如何要选择每秒。就像是
columns = boxinfo.find_all("td").nthChild(2)
Run Code Online (Sandbox Code Playgroud)
我正在抓取的表结构
<div class="box1">
<table class="table1">
<tr><td class="label">Item1</td><td>Value1</td></tr>
<tr><td class="label">Item2</td><td>Value2</td></tr>
<tr><td class="label">Item3</td><td>Value3</td></tr>
<tr><td class="label">Item4</td><td>Value4</td></tr>
</table>
</div>
Run Code Online (Sandbox Code Playgroud)
代码
#Find our information
boxinfo = soup.find("div", {"id": "box1"})
headings = boxinfo.find_all("td", {"class": "label"})
columns = boxinfo.find_all("td").nthChild(2) #This does not work :(
Run Code Online (Sandbox Code Playgroud) 我试图做一些不寻常的事情作为另一个问题的解决方法.我想存储ruby命令并在以后执行它们.
我可以将命令存储在变量ok中,但我只能将它们打印到屏幕上,我玩弄扁平以查看是否可以以某种方式将它们转换为可用的形式,但它不起作用.
这是一个例子:
Command_Store = Array[puts "Hello World", my_first_array = array.new, puts "Hello World again"]
execute.Command_Store[0] => Hello World
execute.Command_Store[1] => my.first_array[]
execute.Command_Store[2] => Hello World again
Run Code Online (Sandbox Code Playgroud) 以下代码生成错误,我看不到问题.有人可以帮忙吗?
customer_array = [‘Ken’,’William’,’Catherine’,’Mark’,’Steve’,’Sam’]
customer_hash = {
‘Ken’ => ‘Fiction’,
‘William’ => ‘Mystery’,
‘Catherine’ => ‘Computer’,
‘Mark’ => ‘Fiction’,
‘Steve’ => ‘Sports’,
‘Sam’ => ‘Fiction’
}
# => customer_array.rb:6: syntax error, unexpected tSTRING_BEG , expecting '}'
# 'William' => 'Mystery'
# ^
Run Code Online (Sandbox Code Playgroud)