How can I stream the output of Enum.to_list to text for insertion into an editor?

If you want to stream the whole thing you should be able to do

File.stream!("tmp.csv") \
|> DataMorph.structs_from_csv("open-register", :iso_country) \
|> Stream.map(fn(struct) -> "iso: #{struct.iso}, name: #{struct.name}\n" end) \
|> Stream.into(File.stream!("output.txt")) \
|> Stream.run
1 Like