Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default cacatenation script

I'd appreciate it if someone could help me out on this.
I have a large dataset with about 50,000 lines. There are seven fields
across. I'd like to be able to do the following:

The computer cacatenates all the fields in the dataset into one
continuous line across for each of the rows in the dataset.

Then, for each row for which the name in the first column is the same,
it cacatenates that row after the previous row with the same field name
in the first column, and does this for all the rows.

For example:

country year note1 etc...
France 1990 abcd
England 1991 abcd
France 1994 1234
France 1993 aaaa
England 1992 1234
USA 2000 bbbb

becomes cacatenated as:

France 1990 abcd 1994 1234 1993 aaaa etc.
England 1991 abcd 1992 1234 etc.
USA 2000 bbbb

Thanks in advance.

Matthew Kramer


*** Sent via Developersdex http://www.developersdex.com ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default cacatenation script

I assume you want the data in seperate columns? Your question is not quite
clear. To do that...

On the Menu bar select Data - Text to Columns. It is hard to tell from your
post but as a guess the text is tab delimited, so select Delimited. Excel
will probabaly guess tab for you and then you can just select Ok. This will
make the columns for you...

HTH

"matthew kramer" wrote:

I'd appreciate it if someone could help me out on this.
I have a large dataset with about 50,000 lines. There are seven fields
across. I'd like to be able to do the following:

The computer cacatenates all the fields in the dataset into one
continuous line across for each of the rows in the dataset.

Then, for each row for which the name in the first column is the same,
it cacatenates that row after the previous row with the same field name
in the first column, and does this for all the rows.

For example:

country year note1 etc...
France 1990 abcd
England 1991 abcd
France 1994 1234
France 1993 aaaa
England 1992 1234
USA 2000 bbbb

becomes cacatenated as:

France 1990 abcd 1994 1234 1993 aaaa etc.
England 1991 abcd 1992 1234 etc.
USA 2000 bbbb

Thanks in advance.

Matthew Kramer


*** Sent via Developersdex http://www.developersdex.com ***

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default cacatenation script

With 50k records this might get tedious, but here's an
approach that does not require coding.

Sort the dataset on col 1. For each block of repeated
names use "&" to tack the cell contents together. Put the
formulas in, say col 8. You would have two types of
formula:

Start of block: col 1 & col2 & ... & col 7
Subsequent rows: (previous row)col 8 & col2 & ... & col 7

If this is a once-off, this might be the easiest approach
with the judicious use of fill-down. If you expect to do
this more than once on different datasets, you might try
coding it. Either way, using Excel's sort and & will
likely help.

Tony


-----Original Message-----

.....

For example:

country year note1 etc...
France 1990 abcd
England 1991 abcd
France 1994 1234
France 1993 aaaa
England 1992 1234
USA 2000 bbbb

becomes cacatenated as:

France 1990 abcd 1994 1234 1993 aaaa etc.
England 1991 abcd 1992 1234 etc.
USA 2000 bbbb

Thanks in advance.

Matthew Kramer


*** Sent via Developersdex http://www.developersdex.com

***
.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cacatenation and SUMPRODUCT [email protected] Excel Discussion (Misc queries) 4 March 8th 07 08:57 PM
cacatenation code Matthew Kramer Excel Programming 2 September 17th 04 10:40 AM
Excel 2000/XP script to Excel97 script hat Excel Programming 3 March 2nd 04 03:56 PM
VB Script Help Quanchi[_4_] Excel Programming 4 November 12th 03 01:19 PM
VB Script help Quanchi Excel Programming 3 October 6th 03 03:13 PM


All times are GMT +1. The time now is 09:44 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"