Alcaic Research and technology, not iambic verse.

17Jan/100

Notational Velocity to Simplenote

Adding a header to a file based on filename

A little something I needed to import my Notational Velocity notes into Simplenote. I like using Markdown when I need a fancy version of my notes, hence the need for the title (which NV does not keep in the file).

for file in *.txt; do
    cp $file $file.saved
    echo "$(basename -s .txt $file)" > header.temp
    sed s/./=/g header.temp > header_line.temp
    cat header.temp header_line.temp $file.saved >$file
done

May help you as well (keep a backup !).

Comments (0) Trackbacks (0)

No comments yet.


Leave a comment

No trackbacks yet.