Csound Csound-dev Csound-tekno Search About

[Csnd] read text file in a specific line

Date2018-01-16 14:31
Fromluis antunes pena
Subject[Csnd] read text file in a specific line

Dear all,

I'm looking for an opcode that can read a text file and navigate from line to line. I'm aware of read, readk and readfi but none seams to work like this.

Is there another possibility I'm miising? What would be your solution?

Thanks.

Luis


Date2018-01-16 15:39
FromTarmo Johannes
SubjectRe: [Csnd] read text file in a specific line
I guess readfi in a while loop where you count the lines until the one you need would do the job
https://stackoverflow.com/questions/2081836/reading-specific-lines-only-python

this is a python example -  and of course you could use also python code but it is difficult to get string from python code to csound.

greetings,
tarmo

2018-01-16 16:31 GMT+02:00 luis antunes pena <antunespena@web.de>:

Dear all,

I'm looking for an opcode that can read a text file and navigate from line to line. I'm aware of read, readk and readfi but none seams to work like this.

Is there another possibility I'm miising? What would be your solution?

Thanks.

Luis

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

Date2018-01-16 23:59
Fromluis antunes pena
SubjectRe: [Csnd] read text file in a specific line

Thanks Tarmo. After some time working with the strxxxx opcodes I could finally apply your suggestion in csound. It works now. Thanks for the hint.

Luís


Am 16.01.18 um 16:39 schrieb Tarmo Johannes:
I guess readfi in a while loop where you count the lines until the one you need would do the job
https://stackoverflow.com/questions/2081836/reading-specific-lines-only-python

this is a python example -  and of course you could use also python code but it is difficult to get string from python code to csound.

greetings,
tarmo

2018-01-16 16:31 GMT+02:00 luis antunes pena <antunespena@web.de>:

Dear all,

I'm looking for an opcode that can read a text file and navigate from line to line. I'm aware of read, readk and readfi but none seams to work like this.

Is there another possibility I'm miising? What would be your solution?

Thanks.

Luis

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