Hello
How I can insert a new line after each dot using regex?
- I'm using the chrome extension.
Thanks.
Hello
How I can insert a new line after each dot using regex?
Thanks.
You can replace dot symbol on new line (tab) by using Excel after you scraped what you need...
Thanks don, I found this solution:
I used (Grouped Selector) so I got JSON output
Then I used this code to make a function in Google Sheet > Apps Script
function convertJsonToText(jsonString) {
var jsonData = JSON.parse(jsonString);
var plainText = '';
// Recursive function to traverse through the JSON object
function traverse(obj, depth) {
for (var key in obj) {
if (typeof obj[key] === 'object') {
traverse(obj[key], depth + 1);
} else {
var indent = ' '.repeat(depth * 2); // Adjust the number of spaces for indentation
plainText += indent + key + ': ' + obj[key] + '\n' + '\n';
// Add an extra empty line after each dot
if (key === '.') {
plainText += '\n';
}
}
}
}
traverse(jsonData, 0);
return plainText;
}