[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Challenge with FasterCSV

junkone

8/5/2006 12:48:00 PM

HI
How can i define the header to be in the 3row of the the array loaded
After the array is loaded can i redefine the header.

for eg in the following cod
require "faster_csv"
arr_of_arrs = FasterCSV.read("c:\\temp\\QuoteData.dat")
currentPrice=arr_of_arrs.values_at(0)[0][1]
arr_of_arrs.delete_at(0)
arr_of_arrs.delete_at(0)

I dont know how to define the header for the arr_of_arrs. I a unclear
after reading the docs

12 Answers

James Gray

8/5/2006 4:40:00 PM

0

On Aug 5, 2006, at 7:50 AM, junkone@rogers.com wrote:

> HI
> How can i define the header to be in the 3row of the the array loaded
> After the array is loaded can i redefine the header.
>
> for eg in the following cod
> require "faster_csv"
> arr_of_arrs = FasterCSV.read("c:\\temp\\QuoteData.dat")
> currentPrice=arr_of_arrs.values_at(0)[0][1]
> arr_of_arrs.delete_at(0)
> arr_of_arrs.delete_at(0)
>
> I dont know how to define the header for the arr_of_arrs. I a unclear
> after reading the docs

I'm sorry, but I don't think I understand the question well enough to
answer it. Could you please show a small sample data set and what
you would like to accomplish?

James Edward Gray II

junkone

8/6/2006 12:41:00 AM

0


James Edward Gray II wrote:
> On Aug 5, 2006, at 7:50 AM, junkone@rogers.com wrote:
>
> > HI
> > How can i define the header to be in the 3row of the the array loaded
> > After the array is loaded can i redefine the header.
> >
> > for eg in the following cod
> > require "faster_csv"
> > arr_of_arrs = FasterCSV.read("c:\\temp\\QuoteData.dat")
> > currentPrice=arr_of_arrs.values_at(0)[0][1]
> > arr_of_arrs.delete_at(0)
> > arr_of_arrs.delete_at(0)
> >
> > I dont know how to define the header for the arr_of_arrs. I a unclear
> > after reading the docs
>
> I'm sorry, but I don't think I understand the question well enough to
> answer it. Could you please show a small sample data set and what
> you would like to accomplish?
>
> James Edward Gray II

A sample data is in this link
http://www.geocities.com/murthysure...

I am trying to load this file using
arr_of_arrs = FasterCSV.read("c:\\temp\\QuoteData.dat")

I assign the current price using
currentPrice=arr_of_arrs.values_at(0)[0][1]

I then delete the first two lines of the data as they are not useful
anymore
arr_of_arrs.delete_at(0)
arr_of_arrs.delete_at(0)

Now i want to use the 3rd line that u see in the link as my header for
the csv records.
for eg the Calls should refer to the first column, Last Sale for second
column

I am not sure if this is feasible

Thanks in advance

Seede

James Gray

8/6/2006 3:05:00 PM

0

On Aug 5, 2006, at 7:45 PM, junkone@rogers.com wrote:

> A sample data is in this link
> http://www.geocities.com/murthysure...

> I am not sure if this is feasible

Sure it is. Here's the skeleton code to get you going:

require "faster_csv"

File.open("ABC.TXT") do |file|
current_price = file.gets.parse_csv(:row_sep => "\r\r\n")[1]
file.gets
FCSV(file, :row_sep => "\r\r\n", :headers => true) do |csv|
csv.each do |row|
# ... use current_price and row here ...
end
end
end

You may not need those odd :row_sep settings. The file I downloaded
had very odd line endings, but that may have been a web server or
browser mucking with the data along the way.

Hope that helps.

James Edward Gray II


Chairman Mao , expert fucker of Chinese High School Girl 's cunts in China

5/14/2013 5:03:00 AM

0

GERMANY the 4th REICH is coming back via the EURO.


never doubt the ability of the German people to rise up
again .




we CHINESE are also on the way up,
but this WHITE POWER CHRISTIAN church has never let go
of its WHITE POWER BASE since
the middle of the 13th century , since the Albegian Massacre
in
South FRANCE .





n May 14, 11:39 am, "Welfare Dept." <welfared...@gmail.com> wrote:
> From 1913 to today 2013 which is 100 years that changes the World
> quite alot so we never know what will happen for Tibet and that also
> can be China
>
> Look at the Nazis and Japan Imperialism both rise and fall only within
> 20 years
>
> But read  World History every country they all love Freedom
>
> On May 13, 9:31 pm, rst0 <rst0w...@yahoo.com> wrote:> Well, there is still hope for Tibet.
>
> => Tibet will be fine as soon as Tibetans get rid of the Dalai Lama
> and
>
>
>
>
>
>
>
> > his Buddhism.

rst0wxyz

5/14/2013 5:06:00 AM

0

On May 13, 9:39 pm, "Welfare Dept." <welfared...@gmail.com> wrote:
> From 1913 to today 2013 which is 100 years that changes the World
> quite alot so we never know what will happen for Tibet and that also
> can be China

Yes, definitely.

>
> Look at the Nazis and Japan Imperialism both rise and fall only within
> 20 years

Nazi Germany did, but imperial Japan lasted from the late 1800s to
1945.

>
> But read  World History every country they all love Freedom

Different countries have different interpretation of freedom.
Take the U.S., for example, was the U.S. "love Freedom" from the 1700s
to 1960s?
Thomas Jefferson wrote "All men are created equal" yet, he owned,
bought and sold slaves all through his life.

Was Marin Luther King, jr.'s life in vain?
How about Nelson Mandela?


>
> On May 13, 9:31 pm, rst0 <rst0w...@yahoo.com> wrote:> Well, there is still hope for Tibet.
>
> => Tibet will be fine as soon as Tibetans get rid of the Dalai Lama
> and
>
>
>
>
>
>
>
> > his Buddhism.

Chairman Mao , expert fucker of Chinese High School Girl 's cunts in China

5/14/2013 5:12:00 AM

0

ja

remember Alfred Hugenburg who financed A. Hitler 's Rise to
Power ?


http://en.wikipedia.org/wiki/Alfred...



his German Verband = Pan GERMAN EXPANSION modelling after
the Prussian Settlement Commission .



http://en.wikipedia.org/wiki/Prussian_Settlement_...




On May 14, 12:05 pm, rst0 <rst0w...@yahoo.com> wrote:
> On May 13, 9:39 pm, "Welfare Dept." <welfared...@gmail.com> wrote:
>
> > From 1913 to today 2013 which is 100 years that changes the World
> > quite alot so we never know what will happen for Tibet and that also
> > can be China
>
> Yes, definitely.
>
>
>
> > Look at the Nazis and Japan Imperialism both rise and fall only within
> > 20 years
>
> Nazi Germany did, but imperial Japan lasted from the late 1800s to
> 1945.
>
>
>
> > But read  World History every country they all love Freedom
>
> Different countries have different interpretation of freedom.
> Take the U.S., for example, was the U.S. "love Freedom" from the 1700s
> to 1960s?
> Thomas Jefferson wrote "All men are created equal" yet, he owned,
> bought and sold slaves all through his life.
>
> Was Marin Luther King, jr.'s life in vain?
> How about Nelson Mandela?
>
>
>
>
>
>
>
>
>
> > On May 13, 9:31 pm, rst0 <rst0w...@yahoo.com> wrote:> Well, there is still hope for Tibet.
>
> > => Tibet will be fine as soon as Tibetans get rid of the Dalai Lama
> > and
>
> > > his Buddhism.

Welfare Dept.

5/14/2013 5:33:00 AM

0

The true Freedom that can let people speak and vote, with those
Privileges that transform the nation to better society

None of the Communist countries have these Privileges and thats why
Red China still eat human fetus plus lot of corruptions, as a matter
of fact in Freedom country the citizen can blame or make fun out of
their leaders if there is a mistake but Commies.

Look at your brother N-Korea, their people have to pretend crying loud
at Kim JongIl funeral but without tears then their ration meal of the
month will be cut off 1/2

LMAO


On May 13, 10:05 pm, rst0 <rst0w...@yahoo.com> wrote:
> On May 13, 9:39 pm, "Welfare Dept." <welfared...@gmail.com> wrote:
>
> > From 1913 to today 2013 which is 100 years that changes the World
> > quite alot so we never know what will happen for Tibet and that also
> > can be China
>
> Yes, definitely.
>
>
>
> > Look at the Nazis and Japan Imperialism both rise and fall only within
> > 20 years
>
> Nazi Germany did, but imperial Japan lasted from the late 1800s to
> 1945.
>
>
>
=> > But read  World History every country they all love Freedom
>
-> Different countries have different interpretation of freedom.
> Take the U.S., for example, was the U.S. "love Freedom" from the 1700s
> to 1960s?
-> Thomas Jefferson wrote "All men are created equal" yet, he owned,
> bought and sold slaves all through his life.
>
-> Was Marin Luther King, jr.'s life in vain?
-> How about Nelson Mandela?
>
>
>
>
>
>
>
>
>
> > On May 13, 9:31 pm, rst0 <rst0w...@yahoo.com> wrote:> Well, there is still hope for Tibet.
>
> > => Tibet will be fine as soon as Tibetans get rid of the Dalai Lama
> > and
>
> > > his Buddhism.

George Fernandez , now posting as Fucking Komin the Pedophile Turd , was also posting as George

5/14/2013 7:33:00 AM

0

ja


GERMAN EURO is the BIGGEST ECONOMY in the world .


EURO block is now BIGGER than USA


USA is number 2 now
not number 1




CHINA number 3



so it looks like the GERMAN people are recreating their
4th REICH empire


all Euro nations are now closely linked to the GERMAN
CENTRAL bank



GERMAN shall control all inflations and economic growth
in EURO Empire
which is BIGGER than USA .


GERMAN OECONOMIA is the CENTRAL ENGINE for all EUROPE
continental POWER.



remember in the middle ages economics was written as
oeconomia .

Germany was composed of many smaller states before 1812 ,

NOW Europe is composed of many nations ,just like
GERMANY was
in the Middle ages.












On May 14, 12:02 pm, "Mao , the HEAD of the CPC , Communist
Party of China , Yellow Race Power Block"
<monsteroooodk...@gmail.com> wrote:
> GERMANY  the  4th  REICH is  coming  back  via  the  EURO.
>
> never  doubt  the  ability  of  the  German people  to rise  up
> again .
>
> we  CHINESE  are  also on the  way  up,
> but  this  WHITE  POWER  CHRISTIAN  church  has never   let   go
> of  its  WHITE  POWER  BASE   since
> the   middle  of  the  13th  century , since  the  Albegian  Massacre
> in
> South  FRANCE  .
>
> n May 14, 11:39 am, "Welfare Dept." <welfared...@gmail.com> wrote:
>
>
>
>
>
>
>
> > From 1913 to today 2013 which is 100 years that changes the World
> > quite alot so we never know what will happen for Tibet and that also
> > can be China
>
> > Look at the Nazis and Japan Imperialism both rise and fall only within
> > 20 years
>
> > But read  World History every country they all love Freedom
>
> > On May 13, 9:31 pm, rst0 <rst0w...@yahoo.com> wrote:> Well, there is still hope for Tibet.
>
> > => Tibet will be fine as soon as Tibetans get rid of the Dalai Lama
> > and
>
> > > his Buddhism.

wakalukong

5/14/2013 7:58:00 AM

0

hay Lah




the German minister Jorg Asmussen is proposing
some changes in the treaty for an eventual process
which lead to a European Banking Union for
all banks in EURO block which will eventually come
under GERMAN supervision and German ownership .



for example , German central bank has a large holdings
of
Greek bank 's bonds , so eventually
Greek banks will be under German control .

this is the crystallization of the GERMAN REICH through the
European Banking Union which will be dominated by
German laws and German share holders .


the EUROPE will be controlled by German people and
by German Money Power , just like CHINESE MONEY in Malaysia
which
is controlling the Malay daily business transactions











On May 14, 2:32 pm, "emperor Xi Jin Ping , a billionaire and the
HEAD of Chinese Mafia MONOPOLY CPC POWER in CHINA"
<abalwaleedbinta...@gmail.com> wrote:
> ja
>
> GERMAN  EURO  is  the  BIGGEST  ECONOMY  in  the  world  .
>
> EURO   block  is  now  BIGGER than  USA
>
> USA  is  number  2  now
> not  number  1
>
> CHINA  number  3
>
> so  it  looks  like  the  GERMAN  people  are  recreating   their
> 4th  REICH  empire
>
> all  Euro   nations  are   now  closely  linked   to  the  GERMAN
> CENTRAL  bank
>
> GERMAN   shall   control   all  inflations   and  economic growth
> in  EURO  Empire
> which is  BIGGER  than  USA .
>
> GERMAN   OECONOMIA   is  the  CENTRAL   ENGINE   for  all  EUROPE
> continental  POWER.
>
> remember  in the  middle  ages   economics  was  written   as
> oeconomia  .
>
> Germany  was  composed  of  many  smaller  states  before  1812  ,
>
> NOW   Europe   is  composed  of  many   nations  ,just   like
> GERMANY   was
> in the  Middle  ages.
>
> On May 14, 12:02 pm, "Mao , the  HEAD  of  the  CPC ,  Communist
> Party   of  China  ,  Yellow  Race  Power  Block"
>
>
>
>
>
>
>
> <monsteroooodk...@gmail.com> wrote:
> > GERMANY  the  4th  REICH is  coming  back  via  the  EURO.
>
> > never  doubt  the  ability  of  the  German people  to rise  up
> > again .
>
> > we  CHINESE  are  also on the  way  up,
> > but  this  WHITE  POWER  CHRISTIAN  church  has never   let   go
> > of  its  WHITE  POWER  BASE   since
> > the   middle  of  the  13th  century , since  the  Albegian  Massacre
> > in
> > South  FRANCE  .
>
> > n May 14, 11:39 am, "Welfare Dept." <welfared...@gmail.com> wrote:
>
> > > From 1913 to today 2013 which is 100 years that changes the World
> > > quite alot so we never know what will happen for Tibet and that also
> > > can be China
>
> > > Look at the Nazis and Japan Imperialism both rise and fall only within
> > > 20 years
>
> > > But read  World History every country they all love Freedom
>
> > > On May 13, 9:31 pm, rst0 <rst0w...@yahoo.com> wrote:> Well, there is still hope for Tibet.
>
> > > => Tibet will be fine as soon as Tibetans get rid of the Dalai Lama
> > > and
>
> > > > his Buddhism.

rst0wxyz

5/14/2013 3:12:00 PM

0

On May 13, 10:32 pm, "Welfare Dept." <welfared...@rocketmail.com>
wrote:
> The true Freedom that can let people speak and vote, with those
> Privileges  that transform the nation to better society

China has transformed itself into a much better society.
China is rising fast while the U.S. is declining.
There has never any "true freedom" anywhere in the world including the
U.S.
The latest government power-play; IRS targeted the Tea Party- read
all about it.

>
> None of the Communist countries have these Privileges  and thats why

Communism died when the USSR disappeared. You are really beating the
dead horse pretty bad when you kept referring to communism.

Even Cuba is loosing up on its control of the country.
N. Korea is the only country with dictator in control.

> Red China still eat human fetus plus lot of corruptions, as a matter

China has been a country where hunger and starvation were part of life
for over 5,000 years.
Anything edible will be eaten up including human flesh.

> of fact in Freedom country the citizen can blame or make fun out of
> their leaders if there is a mistake but Commies.

Anyone can make fun of their leaders until a point of no return.
Then heads will roll. It's true in every country.

>
> Look at your brother N-Korea, their people have to pretend crying loud
> at Kim JongIl funeral but without tears then their ration meal of the
> month will be cut off 1/2

How do you know? Do you have a spy in N. Korea better than Uncle Sam?
Kim Jong Il died for a week, and Uncle Sam didn't even know about it
until N. Korea made the announcement.
>

> LMAO

Not only your ass, but also your teeth may also fall off.