# Re: add to words syntaxes

**URL:** <https://www.ruby-forum.com/t/re-add-to-words-syntaxes/82552>\
**Category:** Ruby\
**Created:** [March 16, 2006, 2:08pm UTC](https://www.ruby-forum.com/t/re-add-to-words-syntaxes/82552 "2006-03-16T14:08:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dani](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/35a633/32.png) [@dani](https://www.ruby-forum.com/u/dani)\
**Post date:** [March 16, 2006, 2:08pm UTC](https://www.ruby-forum.com/t/re-add-to-words-syntaxes/82552/1 "2006-03-16T14:08:45Z")

</div>

Hi again!  
Thanks for ALL your support, especially for Carlos. now it works fine!  
Only one more question and I leave this theme.  
What is if I in my TXT file the parameters repeat self?  
So I mean:  
0608A;  
Teszt Kft;  
33445566222;  
;  
20060101;  
20060131;  
0A0001C002A 33445566222  
0A0001C007A Teszt kft

0608M  
Oscar Wild  
123456789  
;  
20060101;  
20060131;  
0A0001C002A 33445566222  
0A0001C007A Teszt kft

etc… So I need, that on the end of the first paragraph it looks for the  
second. How can I do this? With the same syntax, same file.  
Regards:

Daniel

---

<div class="post-metadata">

**Author:** ![dani](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/35a633/32.png) [@dani](https://www.ruby-forum.com/u/dani)\
**Post date:** [March 16, 2006, 4:18pm UTC](https://www.ruby-forum.com/t/re-add-to-words-syntaxes/82552/2 "2006-03-16T16:18:21Z")

</div>

Dani wrote:  
[…]

> second. How can I do this? With the same syntax, same file.  
> Regards:

# Set the “input record delimiter” to “paragraph”. This is

# a special case and you weren’t expected to know it beforehand 🙂

original\_delimiter = $/  
$/ = “”

# … read the “lines” (chunks of text between ) …

chunks = ARGF.readlines

# … and restore the IRS to

$/ = original\_delimiter

# now extract individual lines from each chunk and process them as

before

chunks.each do |chunk|  
lines = chunk.split($/)  
… \< the previous code \> …  
end

HTH - (not tested)
