[QUIZ] To Excel (#17)

Years ago, on a job developing custom reporting software, this was

one of the

side tasks. Parsing a report may sound boring, but I urge you to

at least

download this report and peek inside. It's a tragic example of

database output

gone wrong.

No responses yet??? Too difficult?? Pity - as a Newbie I was
interested to see how the experts handled this one.
Graham

Graham Foster wrote:

No responses yet??? Too difficult?? Pity - as a Newbie I was interested to see how the experts handled this one.

Answers aren't posted until Sunday. Unless someone has a question or are extremely excited about this they usually don't post before then.

Zach

Graham Foster wrote:

No responses yet??? Too difficult??

It looked too much like real work. :slight_smile:

···

--
Glenn Parker | glenn.parker-AT-comcast.net | <http://www.tetrafoil.com/&gt;

No responses yet??? Too difficult??

It's not too difficult, in my opinion. We've done much harder.

Pity - as a Newbie I was interested to see how the experts handled this one.

I think you should give it a shot. You might just surprise yourself and if you get something in before I sit down to write the summary, I'll make you famous! <laughs>

James Edward Gray II

···

On Feb 1, 2005, at 12:05 PM, Graham Foster wrote:

"Graham Foster" <graham@inca.freeserve.company.unitedkingdom> writes:

Years ago, on a job developing custom reporting software, this was

one of the

side tasks. Parsing a report may sound boring, but I urge you to

at least

download this report and peek inside. It's a tragic example of

database output

gone wrong.

No responses yet??? Too difficult?? Pity - as a Newbie I was
interested to see how the experts handled this one.
Graham

Well, here is my try. I wonder if that does it?

salesperson = customer = sortcode = "(undefined)"

$, = ";"

IO.readlines("period2-2002.txt").each { |line|
  case line
  when / Salesperson (.*)/
    salesperson = $1
  when / Customer (.*)/
    customer = $1
  when / SA Sort Code (.*)/
    sortcode = $1
  when /^[0-9A-Z][0-9A-Z.-]+ .*\d+ .*\d+ /
    name, numbers = line[0..41], line[41..-1]

    numbers.gsub! ',', ''
    numbers.gsub! '%%%+', '0'
    
    print salesperson, customer, sortcode,
          *(name.strip.split(/ +/) + numbers.split(/ (?: +|(?=[-\d]))/))
  end
}

···

--
Christian Neukirchen <chneukirchen@gmail.com> http://chneukirchen.org

Sunday was two days ago, this is from last Friday.

I started playing with it, but didn't have time to finish, and was
also looking forward to what others came up with.

···

On Wed, 2 Feb 2005 03:13:00 +0900, Zach Dennis <zdennis@mktec.com> wrote:

Graham Foster wrote:
>
> No responses yet??? Too difficult?? Pity - as a Newbie I was
> interested to see how the experts handled this one.

Answers aren't posted until Sunday. Unless someone has a question or are
extremely excited about this they usually don't post before then.

--
Bill Guindon (aka aGorilla)

I suspect this was my mistake. Should have disguised it better.

I find this kind of project interesting, but I'm a little too geeky to be an unbiased judge.

In defense of the quiz, it can be done with rather little Ruby code. It's requires more detective skills than anything else, I think.

James Edward Gray II

···

On Feb 1, 2005, at 12:49 PM, Glenn Parker wrote:

Graham Foster wrote:

No responses yet??? Too difficult??

It looked too much like real work. :slight_smile:

Very interesting concept. You dropped the "familiar format" idea, but gained a lot of advantages. Ironically, the changes you made have a lot in common with the solution I actually used on the job (I haven't submitted it).

I'll be sure and compare the two approaches in the summary.

James Edward Gray II

···

On Feb 2, 2005, at 7:04 AM, Christian Neukirchen wrote:

Well, here is my try. I wonder if that does it?

Bill Guindon wrote:

Sunday was two days ago, this is from last Friday.

I started playing with it, but didn't have time to finish, and was
also looking forward to what others came up with.

Boy how time flies...it's february already!! sheesh. Sorry Graham...my bad, I didn't realize the date!

Zach

I found it interesting too, I've just been swamped with *real* real work
:slight_smile: Well take a shot at it before the week is through.

martin

···

James Edward Gray II <james@grayproductions.net> wrote:

On Feb 1, 2005, at 12:49 PM, Glenn Parker wrote:

> Graham Foster wrote:
>> No responses yet??? Too difficult??
>
> It looked too much like real work. :slight_smile:

I suspect this was my mistake. Should have disguised it better.

I find this kind of project interesting, but I'm a little too geeky to
be an unbiased judge.

James Edward Gray II <james@grayproductions.net> writes:

Well, here is my try. I wonder if that does it?

Very interesting concept. You dropped the "familiar format" idea, but
gained a lot of advantages. Ironically, the changes you made have a
lot in common with the solution I actually used on the job (I haven't
submitted it).

Well, I never seriously used spreadsheets, and I don't think the
format is *that* much different. However, all information is
contained in one line (great for Unix people, btw :-)) and I think
Excel people could now use AutoFilter or Pivot tables to browse these
sheets (but don't quote me on that, I don't use spreadsheets).

···

On Feb 2, 2005, at 7:04 AM, Christian Neukirchen wrote:

I'll be sure and compare the two approaches in the summary.

James Edward Gray II

--
Christian Neukirchen <chneukirchen@gmail.com> http://chneukirchen.org

hehe, you don't want to know what year it is then :wink:

···

On Wed, 2 Feb 2005 03:42:46 +0900, Zach Dennis <zdennis@mktec.com> wrote:

Boy how time flies...it's february already!! sheesh. Sorry Graham...my
bad, I didn't realize the date!

--
Bill Guindon (aka aGorilla)

You are exactly right. Those are the advantages I was speaking of. It's also great for throwing in a database table.

You can have it both ways though. :wink:

James Edward Gray II

···

On Feb 2, 2005, at 12:53 PM, Christian Neukirchen wrote:

Well, I never seriously used spreadsheets, and I don't think the
format is *that* much different. However, all information is
contained in one line (great for Unix people, btw :-)) and I think
Excel people could now use AutoFilter or Pivot tables to browse these
sheets (but don't quote me on that, I don't use spreadsheets).

Bill Guindon wrote:

···

On Wed, 2 Feb 2005 03:42:46 +0900, Zach Dennis <zdennis@mktec.com> wrote:

Boy how time flies...it's february already!! sheesh. Sorry Graham...my
bad, I didn't realize the date!

hehe, you don't want to know what year it is then :wink:

if i dont ask, you cant tell =)

Since I am just now seeing this I may attempt this using Ruby/JRuby/Java combination. Any objections?!

Zach

I'll be disappointed if you DON'T do it.

James Edward Gray II

···

On Feb 1, 2005, at 12:52 PM, Zach Dennis wrote:

Since I am just now seeing this I may attempt this using Ruby/JRuby/Java combination. Any objections?!