在 google 个工作表中的单元格中的数值后立即提取数据
extract data immediately after numeric value in a cell in google sheets
我在 google 电子表格中有包含数据的单元格作为某个实体的数量,我希望仅提取数量值(数字)之后的字符串。
例如,如果我的数据是:
learn 10 functions
Watch 3 YT tutorial videos
complete 10 charts
我想要的结果是:
functions
YT tutorial videos
charts
我不知道你要找什么语言,但这段代码是用 js 写的。
// cellData is the data that you mentioned
let result = cellData.split(/(\d)/);
console.log(result.pop().trim());
假设您没有在文本中出现多个数字,您可以使用此正则表达式。
(?<=\d\s).+$
此正则表达式将匹配数字后跟一个 space 到行尾的所有字符。
尝试:
=INDEX(IFNA(REGEXEXTRACT(A1:A, "\d+ (.+)")))
我在 google 电子表格中有包含数据的单元格作为某个实体的数量,我希望仅提取数量值(数字)之后的字符串。
例如,如果我的数据是:
learn 10 functions
Watch 3 YT tutorial videos
complete 10 charts
我想要的结果是:
functions
YT tutorial videos
charts
我不知道你要找什么语言,但这段代码是用 js 写的。
// cellData is the data that you mentioned
let result = cellData.split(/(\d)/);
console.log(result.pop().trim());
假设您没有在文本中出现多个数字,您可以使用此正则表达式。
(?<=\d\s).+$
此正则表达式将匹配数字后跟一个 space 到行尾的所有字符。
尝试:
=INDEX(IFNA(REGEXEXTRACT(A1:A, "\d+ (.+)")))