[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

printing

Johnathan Smith

12/10/2007 11:43:00 PM

hi

im trying to:
# open a .txt file and read all the lines in the file
# run a regular expression to find in the form of (some text) (then
anything in [])(some text)
# iterate through each line in the file until no references left

i have achieved the following but i want to print out the references

im unsure how to do this.
any help would be much appreciated
iv provided my code below

thanks

ruby class:

File.open('testnew.txt').each do |line|
if line =~ /(.*?)\[(.*?)\](.*)/
end

puts


txt file - i know it doesnt make any sense

uhvbguyfgtyftyf [ref1] jhvbufgytf [ref2, ref1]
jhvytfdr [ref2]
--
Posted via http://www.ruby-....

6 Answers

Phrogz

12/11/2007 1:11:00 AM

0

On Dec 10, 4:42 pm, Johnathan Smith <stu...@hotmail.com> wrote:
> im trying to:
> # open a .txt file and read all the lines in the file
> # run a regular expression to find in the form of (some text) (then
> anything in [])(some text)
> # iterate through each line in the file until no references left
>
> i have achieved the following but i want to print out the references
>
> im unsure how to do this.
> any help would be much appreciated
> iv provided my code below
>
> ruby class:
>
> File.open('testnew.txt').each do |line|
> if line =~ /(.*?)\[(.*?)\](.*)/
> end

File.open('testnew.txt').each do |line|
if line =~ /(.*?)\[(.*?)\](.*)/
puts line
end
end

Robin

6/2/2008 7:41:00 PM

0

On Jun 2, 2:30 pm, "Pieter" <hrdou...@zonnet.nl> wrote:
> "Robin" <miracle...@gmail.com> schreef in berichtnews:77f84250-c676-4156-903d-8913e2679855@u36g2000prf.googlegroups.com...
>
>
>
> > On Jun 2, 8:26 am, "Pieter" <hrdou...@zonnet.nl> wrote:
> >> "Robin" <miracle...@gmail.com> schreef in
> >> berichtnews:dad1f2cf-02e0-4768-8e5a-f3be3033d15c@j33g2000pri.googlegroups.com...
>
> >> > I am a savor, it is my function to share the light in my mind with my
> >> > brother, telling someone that they are not fooling me with their crap
> >> > is perfectly consistent and Loving.
>
> >> - You apparently have no idea how it
> >> comes across when you say to someone:
> >> "you are not fooling me with your crap."
> >> Be sure that it certainly does NOT come
> >> across as loving, but instead as judgmental
> >> and insulting. And in addition one should
> >> not fool oneself that it is loving to say so.
>
> > Apparently!
>
> > By the way, I wasn't directing that comment at anyone
>
> Understood.
>
> > I see not Joy in
> > that but if I am going to join in the discussion here I'm also not
> > going to lie about what I see, as I see, you obviously are not either!
>
> Quite correct!
> When I read posts, very often
> the ego in me speaks first. And
> it is good at giving labels! Yet
> of the Course I know: that says
> more about me than about the
> writer of the post I'm reading.
> So I let my ego cease raging,
> give my ego reactions to the
> Holy Spirit, and ask for return
> to His guidance.My intention at
> least is to post here only under
> His guidance.

It was the Holy Spirit then who told you to tell me I am not coming
across as Loving... ??? Which Course did you say you were studying ???

Just fooling with you Pieter, I get what you are really saying because
I see your intentions very clearly...

miraclelurker

6/2/2008 7:47:00 PM

0

Gene wrote:
> miraclelurker <miraclelurker@charter.net> wrote in news:g21er1
> $r48$2@aioe.org:
>
>>> Strangely enough, the Course tells us to love out brother as
>>> ourself, but not to spit on him by rejecting his reality.
>> Why do you find that strange?
>
> I find it strange that anyone thinks they can respect the
> Sonship while disrespecting the Sons which comprise it. It
> becomes a religion of contempt. The Course is about love, not
> clever masks for hatred.

Just not understanding why you brought it up. Who is advocating for
clever masks for hatred?


> "If you believe that all of the Souls that God created ARE His
> Sons, and if you also believe that the Sonship is One, then
> every Soul MUST be a Son of God , or an integral part of the
> Sonship. You do not find the concept that the whole is greater
> than its parts difficult to understand. You should therefore
> not have too great difficulty with this. The Sonship in its
> Oneness DOES transcend the sum of its parts. However, it loses
> this special state as long as any of its parts are missing.
> This is why the conflict cannot ultimately be resolved UNTIL
> all of the individual parts of the Sonship have returned. Only
> then, in the true sense, can the meaning of wholeness be
> understood."
>

Gene Ward Smith

6/2/2008 7:56:00 PM

0

miraclelurker <miraclelurker@charter.net> wrote in news:g21ipr
$aj2$1@aioe.org:

> Just not understanding why you brought it up. Who is
advocating for
> clever masks for hatred?

When you tell people the soul which God created is not real,
what are you saying and what does it imply? Why would you say
such a thing?

--
Change but your mind on what you want to see,
And all the world must change accordingly.

miraclelurker

6/2/2008 8:05:00 PM

0

Gene wrote:
> miraclelurker <miraclelurker@charter.net> wrote in news:g21ipr
> $aj2$1@aioe.org:
>
>> Just not understanding why you brought it up. Who is
> advocating for
>> clever masks for hatred?
>
> When you tell people the soul which God created is not real,
> what are you saying and what does it imply? Why would you say
> such a thing?
>

I haven't.

Pieter

6/2/2008 8:30:00 PM

0


"Robin" <miracleweb@gmail.com> schreef in bericht
news:f6b2dab0-d54e-47e1-a26f-a62d74804543@a32g2000prf.googlegroups.com...
> On Jun 2, 2:30 pm, "Pieter" <hrdou...@zonnet.nl> wrote:
>> "Robin" <miracle...@gmail.com> schreef in
>> berichtnews:77f84250-c676-4156-903d-8913e2679855@u36g2000prf.googlegroups.com...
>>
>>
>>
>> > On Jun 2, 8:26 am, "Pieter" <hrdou...@zonnet.nl> wrote:
>> >> "Robin" <miracle...@gmail.com> schreef in
>> >> berichtnews:dad1f2cf-02e0-4768-8e5a-f3be3033d15c@j33g2000pri.googlegroups.com...
>>
>> >> > I am a savor, it is my function to share the light in my mind with
>> >> > my
>> >> > brother, telling someone that they are not fooling me with their
>> >> > crap
>> >> > is perfectly consistent and Loving.
>>
>> >> - You apparently have no idea how it
>> >> comes across when you say to someone:
>> >> "you are not fooling me with your crap."
>> >> Be sure that it certainly does NOT come
>> >> across as loving, but instead as judgmental
>> >> and insulting. And in addition one should
>> >> not fool oneself that it is loving to say so.
>>
>> > Apparently!
>>
>> > By the way, I wasn't directing that comment at anyone
>>
>> Understood.
>>
>> > I see not Joy in
>> > that but if I am going to join in the discussion here I'm also not
>> > going to lie about what I see, as I see, you obviously are not either!
>>
>> Quite correct!
>> When I read posts, very often
>> the ego in me speaks first. And
>> it is good at giving labels! Yet
>> of the Course I know: that says
>> more about me than about the
>> writer of the post I'm reading.
>> So I let my ego cease raging,
>> give my ego reactions to the
>> Holy Spirit, and ask for return
>> to His guidance.My intention at
>> least is to post here only under
>> His guidance.
>
> It was the Holy Spirit then who told you to tell me I am not coming
> across as Loving... ???

As you said: your comment was
not directed to someone; imo that's
why the Holy Spirit allowed me to say
how it would come across if you did. :-)

> Which Course did you say you were studying ???

The required one and only. ;-)

> Just fooling with you Pieter, I get what you are really saying because
> I see your intentions very clearly...

Thanks!