What I’m trying to do
I have hundreds of notes in my zettelkasten like the titles below:
- C20.S01.I01
- C20.S01.I02
- C20.S01.I03
- C20.S01.I04
- C20.S02.I05
- C20.S02.I06
- C20.S03.I07
- C20.S04.I08
(…)
I use this code to bring up all the contents:
```dataviewjs
//Configurations
const pages = dv.pages('#C20').sort(p => p.file.name, "asc");// Make your search
const headName = "";
for (const page of pages) {
const content = await dv.io.load(page.file.path);
const lines = content.split('\n');
var output = [];
var insideHead = false;
// Displaying the file name
dv.header(3, page.file.name);
for (const line of lines) {
if (line.startsWith("# " + headName)) {
insideHead = true;
} else if (line.startsWith("# ") && insideHead) {
insideHead = false;
break; // Exit the loop when the next heading is encountered
} else if (insideHead) {
output.push(line);
}
}
dv.paragraph(output.join('\n'));
}
But, if I only want the notes that filename start with “C20.S01.”, without bringing the rest, how do I do that?
Thankyou everybody