Re: [Pharo-dev] Usage of stream

2015-05-16 Thread stepharo
If you want to convert character encoding, read the chapter of Zinc on encodings https://ci.inria.fr/pharo-contribution/job/EnterprisePharoBook/ws/Zinc-Encoding-Meta/ Le 16/5/15 07:48, valmy roi a écrit : Hi everyone, I have a stream (read from a file) and i want to iterate through it in ord

Re: [Pharo-dev] Usage of stream

2015-05-16 Thread Sven Van Caekenberghe
To replace all X's in input.txt with Y's in output.txt, you can do: 'input.txt' asFileReference readStreamDo: [ :in | 'output.txt' asFileReference writeStreamDo: [ :out | [ in atEnd ] whileFalse: [ | ch | (ch := in read) = $X ifTrue: [ out nextPut: $Y ] ifFals

Re: [Pharo-dev] Usage of stream

2015-05-16 Thread Sergio Fedi
Well, when retrieving some bytes from the read stream you will have them, temporarily, in a collection (OrderedCollection or Array I assume) With that you can use the messages from those collections: 'a3a' copyReplaceAll: '3' with: 'R' ​Which gives 'aRa'

Re: [Pharo-dev] Usage of stream

2015-05-16 Thread valmy roi
that is my problem, replacing the character with another one, how can i do it? 2015-05-16 11:28 UTC+01:00, Sergio Fedi : > Maybe you should open a stream reading the original file > the open a writing stream for the copy file > And reading from one, writing on the other, replacing what you need in

Re: [Pharo-dev] Usage of stream

2015-05-16 Thread Sergio Fedi
Maybe you should open a stream reading the original file the open a writing stream for the copy file And reading from one, writing on the other, replacing what you need in the intermediate collection of bytes/characters ​

Re: [Pharo-dev] Usage of stream

2015-05-16 Thread valmy roi
pharo-dev-boun...@lists.pharo.org] De la part de >> valmy roi >> Envoyé : samedi 16 mai 2015 07:48 >> À : pharo-dev@lists.pharo.org >> Objet : [Pharo-dev] Usage of stream >> >> Hi everyone, >> I have a stream (read from a file) and i want to iterate through it

Re: [Pharo-dev] Usage of stream

2015-05-16 Thread Sergio Fedi
aro.org] De la part de > valmy roi > Envoyé : samedi 16 mai 2015 07:48 > À : pharo-dev@lists.pharo.org > Objet : [Pharo-dev] Usage of stream > > Hi everyone, > I have a stream (read from a file) and i want to iterate through it in > order to replace every occurences of a special

Re: [Pharo-dev] Usage of stream

2015-05-16 Thread Vincent BLONDEAU
: Pharo-dev [mailto:pharo-dev-boun...@lists.pharo.org] De la part de valmy roi Envoyé : samedi 16 mai 2015 07:48 À : pharo-dev@lists.pharo.org Objet : [Pharo-dev] Usage of stream Hi everyone, I have a stream (read from a file) and i want to iterate through it in order to replace every occurences of a special cha

[Pharo-dev] Usage of stream

2015-05-15 Thread valmy roi
Hi everyone, I have a stream (read from a file) and i want to iterate through it in order to replace every occurences of a special character by another one. how can i do it ? -- Kenfack Valmy-Roi Ingénieur des travaux en Informatique de Gestion/ Analyste Programmeur Elève ingénieur de conception