英文:
Is it possible to bulk replace strings in an Excel file via API?
问题
能够通过 Microsoft Graph API 批量替换 Excel 文件中的字符串吗?如果不行,是否有其他方法可以实现这个功能?感谢您的提前帮助。
英文:
Is it possible to bulk replace strings in an Excel file via API?
Hello, I am aware that Google Sheets has an API called "FindReplaceRequest" (https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/request#findreplacerequest)
which can be used to replace values in a spreadsheet with any desired string.
I am interested in achieving the same functionality in Microsoft Excel. I have come across the Microsoft Graph API (https://learn.microsoft.com/en-us/graph/overview)
but I am not sure if this API can be used or if there are other methods available to achieve this.
Could you please advise if it is possible to replace strings in an Excel file via Microsoft Graph API?
If not, how can I do that with any other methods?
I would greatly appreciate any insights as I am not very familiar with Microsoft services, thank you in advance.
答案1
得分: 1
You can use Microsoft Graph to invoke any workbook function.
Check list of supported functions.
Example for replace function:
POST https://graph.microsoft.com/beta/me/drive/root:/path/to/file/fileName.xlsx:/workbook/functions/replace
content-type: Application/Json
authorization: Bearer {access-token}
workbook-session-id: {session-id}
{
"oldText": "old text",
"startNum": 0,
"numChars": 8,
"newText": "new text"
}
英文:
You can use Microsoft Graph to invoke any workbook function.
Check list of supported functions.
Example for replace function
POST https://graph.microsoft.com/beta/me/drive/root:/path/to/file/fileName.xlsx:/workbook/functions/replace
content-type: Application/Json
authorization: Bearer {access-token}
workbook-session-id: {session-id}
{
"oldText": "old text",
"startNum": 0,
"numChars": 8,
"newText": "new text"
}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论