I have a string
a = """
---
title: Just a test
author: Me
date: 2022-01-03
---
# Test Header
Some text.
"""
from which I want to create a file foobar.jmd. What is the best way of doing this?
fname = "foobar.jmd"
dirpath = "/tmp"
fpath = joinpath(dirpath, fname)
open(fpath, "w") do file
write(file, a)
end
More examples e.g. here https://en.wikibooks.org/wiki/Introducing_Julia/Working_with_text_files
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With