After exporting SimpleNotes
I'll create directories for each tags and organize them.
notes.zip
file will be downloaded. notes/source/notes.json
notes
directorymkdir "Untagged Notes"
for f in *.txt
do
if grep -q "Tags:" $f ; then
tag=`tail -n 1 $f | xargs`
mkdir "${tag}"
mv $f "${tag}"
else
mv $f "Untagged Notes"
fi
done
--
tag=$(sed -ne '$p' ${f})
You can also use this to get the last line
--
Searching for other methods Algorithm
Retrieve only the second-to-last line, and if it is not Tags:
(check line number) -1
wc
cat
cut
awk
sed
etc.. I was going to use
-
Check for the presence of certain characters
grep -q STRING FILE
--------
Improvements
I wanted to put symbolic links when there are more than two tags, but
…
---
The content of the something.txt file is
Tags:
study, planning
something like this
-
what is written in the json is
"tags": [
"write"
]
- -
snt.py
import re
import subprocess
with open('./source/notes.json','r') as f:
j = f.read()
t = re.findall('"tags": \[
"(.*)"
\]', 'j')
os.makedirs(t)
I'm not sure how to handle [] escape
ーー
ーー
My Current Notes Environment Usage
Notes
Exporter
does not keep the creation time.
(Research required)
---
I've write too many
so I use SimpleNotes when outside
ーー
so long Japanese (original language) ver.
https://suityuri.blogspot.com/2021/07/snt.html