1
#N canvas 452 54 925 369 10;
2
#X obj 443 239 print done;
3
#X text 72 260 see also:;
5
#X text 334 293 this outlet gets the lines in sequence.;
7
#X text 127 9 read and write messages into text files;
8
#X obj 406 201 msgfile;
9
#X obj 133 261 textfile;
10
#X text 18 57 The msgfile object is derived from the textfile object
11
and expands its features.;
12
#X text 15 97 new features are :;
13
#X text 127 110 insert \, append \, delete \, replace;
14
#X text 492 36 output one line as a list and move to the next;
15
#X text 90 201 add2 : read "add too" \; append to an existing line
17
#X text 528 222 This outlet gets a bang when you hit the end of the
18
sequence \; it will also get the current position when using "when"
20
#X text 127 97 end \, goto \, skip;
21
#X text 131 127 flush \, where \, this \, prev \, next;
23
#X text 73 163 read/write can handle csv files too;
24
#X text 618 7 part of zexy;
25
#N canvas 585 487 646 300 navigation 0;
28
#X text 140 139 go to beginning;
30
#X text 139 163 go the the end;
31
#X msg 92 214 skip -1;
33
#X text 145 237 where are we now ?;
34
#X text 146 214 go to the <n>th line from here;
35
#X text 142 188 go to line number <n>;
36
#X text 44 38 navigating through the lines of a [msgfile];
37
#X text 42 62 these messages will not output any data;
38
#X text 41 80 'where' will output the position of the "cursor" at the
39
2nd outlet of [msgfile];
46
#X restore 443 84 pd navigation;
47
#N canvas 0 0 458 426 data 0;
53
#X text 154 140 output one line as a list and move to the next;
54
#X text 151 189 output the previous line;
55
#X text 153 229 output the next line;
56
#X text 151 209 output the current line;
58
#X text 153 263 output all lines;
59
#X text 39 37 get the contents of the [msgfile] line-by-line;
60
#X text 37 63 'prev' \, 'this' \, 'next' and 'flush' will not alter
61
the current "cursor" position.;
67
#X restore 443 64 pd data retrieval;
68
#N canvas 489 234 669 573 editing 0;
71
#X msg 140 481 set 2 4 6 8;
72
#X text 246 480 clear and then add one message;
73
#X msg 136 258 add cis boom bah;
74
#X msg 136 277 add2 bang;
75
#X text 190 102 empty the object;
76
#X msg 137 161 delete 2;
77
#X text 272 303 insert a message before the current line;
78
#X text 238 255 add a message at the end of the object;
79
#X msg 137 359 append after the break of dawn;
80
#X text 331 356 add a message at the current position;
81
#X msg 138 437 replace the new day;
82
#X text 330 437 replace the current line;
83
#X msg 136 306 insert before sunrise;
84
#X msg 136 325 insert2 inserted;
85
#X msg 137 378 append2 appendix;
86
#X msg 137 141 delete;
87
#X text 191 142 delete the current line;
88
#X text 194 161 delete the specified line;
89
#X msg 137 180 delete 4 7;
90
#X text 205 181 delete the specified region;
91
#X msg 137 200 delete 7 4;
92
#X text 208 200 delete all but the specified region;
93
#X text 56 39 editing (adding \, modifying \, deleting) the content
95
#X text 237 275 add to the last line (INCOMPATIBLE with [textfile])
97
#X text 275 325 add to the previous line (INCOMPATIBLE with [textfile])
99
#X text 330 379 add to the current line (INCOMPATIBLE with [textfile])
114
#X restore 443 104 pd editing;
115
#N canvas 0 21 676 304 searching 0;
116
#X obj 54 272 outlet;
117
#X msg 70 180 find test 6;
118
#X msg 70 239 find test * 7 *;
119
#X text 73 61 searching (and finding) lines within the [msgfile];
120
#X text 177 241 you can use '*' as a wildchard for a single atom. '*'
121
is the only wildcard supported;
122
#X text 174 178 find a matching list \, starting at the current position
124
#X msg 72 208 find the new day;
125
#X text 76 130 if the search fails \, a 'bang' is emitted at the 2nd
127
#X text 77 99 if the searched list is found \, then the linenumber
128
and the list is output (via the 2nd and 1st outlet).;
132
#X restore 443 124 pd searching;
133
#N canvas 0 0 853 402 file-i/o 0;
134
#X obj 54 312 outlet;
135
#X text 265 75 read a file;
136
#X text 299 96 write one;
137
#X text 305 164 write a file \, terminating lines only with carriage
138
return (omitting semicolons.) You can read files this way too \, in
139
which case carriage returns are mapped to semicolons.;
140
#X msg 87 76 read msgfile.txt;
141
#X msg 87 168 write /tmp/msgfile2.txt cr;
142
#X msg 87 191 read msgfile2.txt cr;
143
#X msg 87 97 write /tmp/msgfile.txt;
144
#X text 51 26 reading from and writing the contents of [msgfile] to
146
#X msg 111 248 write /tmp/msgfile3.txt $$;
147
#X text 331 238 on writing replace every occurence of $$ with a single
148
$. This way you can write pd-patches which can handle arguments.;
149
#X msg 146 291 add #X obj f $\$1;
150
#X msg 92 130 read2 msgfile.txt;
151
#X text 264 131 read file and append it to the current buffer;
159
#X restore 443 144 pd file-i/o;
160
#N canvas 56 448 450 397 misc 0;
161
#X obj 84 282 outlet;
163
#X text 40 72 miscellaneous functionality of [msgfile];
164
#X text 126 114 debugging printout of the contents to the console;
166
#X restore 443 164 pd misc;
167
#X obj 406 267 print data;
168
#X text 9 183 incompatible with [textfile] :;