Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.

stevonz

397 posts

Ultimate Geek

Trusted

Topic # 84630 3-Jun-2011 16:23

I have extracted some data, which is text information with a unique key.  In some (or most) circumstances the data is formatted on different lines with the same unique key.

To keep fidelity of the format it was extracted, I want to add a sequential number, restarting when the unique key changes.  Any ideas?

A12  SWITCH: TEMPERATURE
A12  Model 123
A12  Supplier: Acme
C54  SWITCH: TEMPERATURE
C54  Model 124
C54  Supplier: Acme
D66  Blah

A12  1 SWITCH: TEMPERATURE
A12  2 Model 123
A12  3 Supplier: Acme
C54  1 SWITCH: TEMPERATURE
C54  2 Model 124
C54  3 Supplier: Acme
D66  1 Blah

Any ideas?

Cheers, Stevo

dolbyjr

26 posts

Geek

A12    1                                   SWITCH: TEMPERATURE
A12    =IF(A2=A3,1+B2,1)         Model 123
A12    =IF(A3=A4,1+B3,1)         Supplier: Acme
C54    =IF(A5=A6,1+B5,1)         SWITCH: TEMPERATURE
C54    =IF(A6=A7,1+B6,1)         Model 124
C54    =IF(A7=A8,1+B7,1)         Supplier: Acme
D66    =IF(A8=A9,1+B8,1)         Blah

This might work for you...

stevonz

397 posts

Ultimate Geek

Trusted

Worked a treat... thanks my brain is Friiiied

Cheers, Stevo

News »

UFB killer app: Speed
Posted 17-Nov-2017 17:01

The case for RSS — MacSparky
Posted 13-Nov-2017 14:35

WordPress and Indieweb: Take control of your online presence — 6:30 GridAKL Nov 30
Posted 11-Nov-2017 13:43

Chorus reveals technology upgrade for schools, students
Posted 10-Nov-2017 10:28

Vodafone says Internet of Things (IoT) crucial for digital transformation
Posted 10-Nov-2017 10:06

Posted 9-Nov-2017 10:49

Amazon debuts Fire TV Stick Basic Edition in over 100 new countries
Posted 8-Nov-2017 05:34

Vodafone VoIP transition to start this month
Posted 7-Nov-2017 12:33

Spark enhances IoT network capability
Posted 7-Nov-2017 11:33

Vocus NZ sale and broadband competition
Posted 6-Nov-2017 14:36

Hawaiki reaches key milestone in landmark deep-sea fibre project
Posted 4-Nov-2017 13:53

Countdown launches new proximity online shopping app
Posted 4-Nov-2017 13:50

Nokia 3310 to be available through Spark New Zealand
Posted 4-Nov-2017 13:31

Nest launches in New Zealand
Posted 4-Nov-2017 12:31

Active wholesale as Chorus tackles wireless challenge
Posted 3-Nov-2017 10:55

Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.