[Csnd] Writing and Reading from a .txt file

Hello everybody,

i’m searching a opcode which allows writing to a .txt file with specific row number and line formatting.
Also i need a opcode for reading from a specific line and extracting some values from these lines.

Does something like this exists already in Csound?

Greetings,
Philipp

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        GitHub · Where software is built
Discussions of bugs and features can be posted here

hi philipp -

i'd look into fprints for writing and readf for reading, but i don't know if this satisfies your needs ...

best -
  joachim

Hi!

Or can you use python opcodes pyinit, pycall etc - it could be way easier in python.

Tarmo

N, 27. märts 2025 22:38 joachim heintz <jh@joachimheintz.de> kirjutas:

hi philipp -

i’d look into fprints for writing and readf for reading, but i don’t
know if this satisfies your needs …

best -
joachim

Hello everybody,

i’m searching a opcode which allows writing to a .txt file with specific row number and line formatting.
Also i need a opcode for reading from a specific line and extracting some values from these lines.

Does something like this exists already in Csound?

Greetings,
Philipp

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Hey all,

Both solutions don’t work for my needs.

Can i instead write to a ft and save the data from the ft as txt?

Philipp von Neumann (He/Him)
Composition | Computer Music | Programming

:e-mail: philipp@von-neumann.com
:telephone_receiver: +49 159 01 20 71 03
:globe_with_meridians: von-neumann.com
:loud_sound: SoundCloud: Stream Philipp von Neumann music | Listen to songs, albums, playlists for free on SoundCloud
:herb: Bluesky: @von-neumann.com on Bluesky
:mammoth: Mastodon: Philipp von Neumann (@PvN@mastodon.social) - Mastodon

yes: ftsave
(or ftsavek)

Thanks Joachim!
This works for my purpose!

Philipp von Neumann (He/Him)
Composition | Computer Music | Programming

:e-mail: philipp@von-neumann.com
:telephone_receiver: +49 159 01 20 71 03
:globe_with_meridians: von-neumann.com
:loud_sound: SoundCloud: Stream Philipp von Neumann music | Listen to songs, albums, playlists for free on SoundCloud
:herb: Bluesky: @von-neumann.com on Bluesky
:mammoth: Mastodon: Philipp von Neumann (@PvN@mastodon.social) - Mastodon