Okay brain trust...I KNOW there's got to be an easier way to do this, other than brute force.
So here's what I'm trying to do. Let's say I have a table where things are listed but with an indices indicating indent level
(NOTE: I know this example isn't really logically correct..but hopefully it conveys the problem)
1 Month 1.1 January 1.2 February 2 WeekDay 2.1 Monday 2.2 Tuesday 2.2.1 22nd
Now say I want to convert 1.1 to Month.January
and convert 2.2 to Weekday.Tuesday
and convert 2.2.1 to Weekday.Tuesday.22nd
anyone have an ideas?
I had a couple ideas...but they start getting tricky the lower down in levels I got.
Idea #1: I was thinking of using the "." delimiter to break out the numberical into various columns. meaning, instead of one column going down that has
1 1.1 2 2.1
I'd break it out like this:
1 1 1 2 2 1
Then I could just replace all 1's in the first column with "Month" And all all 2's in the first column with "Weekday". Then similarly in the 2nd column. The problem is...in the 2nd column, if it's a 1....is it a 1 from 1.1 or from 2.1. So now we have to lookup the 1st column to properly convert the 2nd column. This gets particularly messy when I have 5 or 6 levels down (2.1.4.3.13.2)
Idea #2: write a macro that looks at the number and counts the number of "." then add's 1. And in a new table, puts the text (i.e. "Tuesday") in that column. so if 2.1.4.3.13.2 has a value of "milli-seconds"...then "milli-seconds" would be put in the 6th column. If all of these are in order, I believe we'd end up with a table that has rows ike this:
Month Weekday Day Hour Second Milli-Second
Then, once that table's complete, I just spit it out to text with my "." delimiter. So I'd ultimately end up with:
"Month.Weekday.Day.Hour.Second.Milli-Second"
but while I can figure out how to count the "." in the original number...not sure how to write a macro that would copy text into certain columns on a new page.
Or maybe there's even an easier way. Any help would be appreciated.
Bookmarks