Column with number of versions in google sheet - google-sheets

I am using google sheet with data validation to generate autocomplete cells. Does anyone know how you can generate the following in a column:
1.0.0
1.0.1
1.0.2
......
56.2.3
is to then look for the correct version from the main sheet.

or:
=INDEX(REGEXREPLACE(SEQUENCE(COUNTA(B2:B); 1; 100)&""; "(.{1})(.{1}$)"; ".$1.$2"))

try:
=ARRAYFORMULA(ROUNDUP(SEQUENCE(COUNTA(B2:B))/100)&"."&
RIGHT(ROUNDDOWN((SEQUENCE(COUNTA(B2:B))-1)/10), 1)&"."&
RIGHT(SEQUENCE(COUNTA(B2:B))-1, 1))

Related

Unable import text using importxml and xpath inside div

i'm Using Google Sheets with IMPORTXML to scrape a download count information from a japanese website via XPath in google sheet. I want to save the number/text inside this red box
here's the link
https://www.photo-ac.com/main/detail/4465781?title=%E3%82%A2%E3%82%B2%E3%83%8F%E8%9D%B6%E3%81%A8%E3%83%92%E3%83%A3%E3%82%AF%E3%83%8B%E3%83%81%E3%82%BD%E3%82%A6
here's my function
=IMPORTXML("https://www.photo-ac.com/main/detail/4465781?title=アゲハ蝶とヒャクニチソウ", "/html/body/div[17]/div/div/div/div[2]/div[7]/div[1]/div[1]/div/div[3]/div[2]/div[1]//text()")
the function doesn't work? why?
thank you
When I tested your formula, I confirmed that an error of Could not fetch url: occurred. But, fortunately, when Google Apps Script is used, I confirmed that the URL can be requested using UrlFetchApp. So, in this answer, I would like to propose to use Google Apps Script. The sample script is as follows.
Sample script:
Please copy and paste the following script to the script editor of Google Spreadsheet, and save it, and put a formula of =SAMPLE("URL") to a cell. If the function name is not found, please reopen the Google Spreadsheet and test it again. This script is used as the custom function.
function SAMPLE(url) {
const value = UrlFetchApp.fetch(url).getContentText().match(/ダウンロード:.+/);
if (!value) throw new Error("Value was not retrieved.");
return value;
}
Result:
When above script is used, the following result is obtained.
Note:
This sample script is for the current HTML of the URL of https://www.photo-ac.com/main/detail/4465781?title=アゲハ蝶とヒャクニチソウ. And, when the structure of HTML of the URL is changed, above script might not be able to be used. Please be careful this.
References:
Custom Functions in Google Sheets
fetch(url)

Delphi export to Excel (.xlsx)

When export to xls there is no error when export to xlsx there is error into cell " the number in this cell is formatted as text or preceded by an apostrophe" but there is no apostrophe
why strange behavior happening?
Update:
I using QExport4XLS, QExport4Xlsx, kbmMemTable - datasource.
MemTable.FieldDefs.Add('Price', db.ftFloat, 0, False)
...
MemTable.FieldByName('Price').AsFloat := Value
...
QExport4X*.DataSet := MemTable;
...
QExport4X*.Execute;
I think this is happening because in both cases (xls and xlsx) you are exporting the values as string. The recent version of Excel, show you that it thinks the cell's value could be of another type by showing you the upper left green triangle.
You should check the type while exporting.
Whitout seeing the code is obviously a wild guess.
I using v4.0 so it was component problem as according their bug fix tracker after v4.2 they did fix.

Import Html not working on moneycontrol.com

=IMPORTHTML(" http://www.moneycontrol.com/stocks/fno/marketstats/futures/gainers/homebody.php?opttopic=&optinst=allfut&sel_mth=1&sort_order=0 ", "TABLE", 2)
I've tried using IMPORTHTML and IMPORTXML both, however, they do not seem to work. Any suggestions would be greatly appreciated!
This is the error message that comes up on running both the queries:
Error Imported content is empty.
not sure what exactly do you need to import but LIST works from 1 up to 29
=IMPORTHTML("http://www.moneycontrol.com/stocks/fno/marketstats/futures/gainers/homebody.php?opttopic=&optinst=allfut&sel_mth=1&sort_order=0";
"LIST"; 29)
and also you can use "import all":
=IMPORTXML("http://www.moneycontrol.com/stocks/fno/marketstats/futures/gainers/homebody.php?opttopic=&optinst=allfut&sel_mth=1&sort_order=0";
"//*")

Drop down in watir 6.8.4

This is my code for drop down selection using ruby:
ruby version is 2.4.3
watir version 6.8.4
cucumber version 3.01
firefox version 47
b.select(id: 'curLocation').option(text: 'Chennai').select
This code is not working for me.
require 'watir'
b = Watir::Browser.start 'bit.ly/watir-webdriver-demo'
s = b.select_list id: 'entry_1000001'
s.select'Ruby'
s.selected_options
Reference: watir
select_from_list = browser.select_list(:xpath, "xpath")
.option(:text => opts[:yourjson])
select_from_list.select
Its for example.
I hope it will help you
Exactly - you can use .option(:xpath, "xpath")
or .option(code: "xpath")
You are using #select wrong. Take a look at the specs for more examples, but all you have to do is:
b.select(id: 'curLocation').select('Chennai')
Also, Firefox 47 isn't a supported version any longer. Please update to the latest version of Firefox, and the latest geckodriver. Also your title says Watir 6.8.4, but you list 5.1.4, which is deprecated.

How to use Select2 with Inputmask

I am trying to create a Select2 box with InputMask to insert IP addresses and add them as tags.
If I use any of the libraries on its own, it works like a charm but both together results in strange behavior.
When I type in numbers, the mask is not filled but rather it seems to expand.
I changed the type of the select2 <input class=“select2-search__field“> from search to text. The Inputmask library makes this necessary, but it should not cause errors because the types are functionally identical.
I created a Fiddle to show the behavior: Fiddle
HTML:
<select multiple id="sel1" style="width:100%"></select>
JS:
$("#sel1")
.select2({
tags: true
})
.on("select2:open", function () {
$(".select2-search__field")
.attr("type","text")
.inputmask({alias: "ip", greedy: false});
})
In my local example I changed the library to support search and the behavior is the same.
Am I missing something?
There is a bad news for you if you MUST use version 4.0.5.
Fixed in jsfiddle by downgrading select2 to version 4.0.2
The main thing is version <= 4.0.2
https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.2/js/select2.js
Tried 4.0.3 onwards up to 4.0.6-rc.1 but no luck.
Opened up issue select2#5216 with select2.
I did a slight change but that has nothing to do with the problem itself.
$('.select2-search__field').attr('type', 'text');
$('.select2-search__field').attr('style', 'width: 10em;');
$('.select2-search__field')
.inputmask({
alias: 'ip'
});

Resources