B4Print.com

General Category => General Prepress => Topic started by: david on February 13, 2019, 04:37:03 PM

Title: Combine rows in excel to one row
Post by: david on February 13, 2019, 04:37:03 PM

Ok, I got one pain in the butt excel file.It has several rows (not columns) that need to be combined into one cell, which if it was only a few, it wouldn't be that bad using the ole:=A1&" "&A2&" "&A3&" "&A4&" "&A5 (except in this case it would be like e2, e3, e4, e5 and then e10, e11, e12, e13)

but, this file has lots of rows, some are 4 rows in one group, some are 3 rows in another group, then 4 rows, then another 4, etc...( like e2, e3, e4 & e5 combined and then e10, e11, e12 & e13 combined, then e18 & e19, then another group...)

^(.*)&/r^(.*)&/r^(.*)&/r^(.*)&/r/r /1 /2 /3 /4^ = beginning of the line(.*) = all characters, and the parens allows you to replace it as one pattern& = end of the line/r = hard return/r/r = at the end and in between the rows you need to combine, hopefully there is a blank row

/1 /2 /3 /4/r/1 = replace with pattern 1/2 = replace with pattern 2/3 = replace with pattern 3/4 = replace with pattern 4This will also put a space between the patterns and then a hard return at the end.