Output Formatted Text


Posted by Carl A on August 13, 2001 5:56 AM

I have a rather large spreadsheet which I need to convert to formatted text and save to an ascii text file. I have included a small example of what I am trying to accomplish:

EXAMPLE OF SPREADSHEET:

Type of Animal Name Color Sex Weight
cat kitty grey male 15
dog doggie brown female 50
rabbit bunny white male 10


EXAMPLE OF FORMATTED TEXT:

I HAVE A "CAT" HIS NAME IS "KITTY"
KITTY IS "GREY" IN COLOR AND WEIGHS 15 LBS
I HAVE A "DOG" HER NAME IS "DOGGIE"
DOGGIE IS "BROWN" IN COLOR AND WEIGHS 50 LBS
I HAVE A "RABBIT" HIS NAME IS "BUNNY"
BUNNY IS "WHITE" IN COLOR AND WEIGHS 10 LBS

This is a very simplified example of what I am trying to accomplish. Case sensitivity is not important, however, the quotation marks are. Any help you can give me in trying to figure this out would be greatly appreciated.

Posted by Eric on August 13, 2001 8:08 AM

Concatenate?

Col(A-E) row (1) are labeled as stated in your post. In F1 put a single " mark.
In F2 (copy down as needed) put the following
="I have a "&$F$1&A2&$F$1&" "&IF(D2="male","his","her")&" name is "&$F$1&B2&$F$1&" "&$F$1&B2&$F$1&" is "&$F$1&C2&$F$1&" in color, and weighs "&E2&" lbs"
I had to do the "F1" finagling because the extra quote marks wouldn't go in the concatenation otherwise. Also I didnt know if you needed the output broken up on two different lines, so I chose the easier way.
Hope that helps

EXAMPLE OF FORMATTED TEXT: KITTY IS "GREY" IN COLOR AND WEIGHS 15 LBS I HAVE A "DOG" HER NAME IS "DOGGIE" DOGGIE IS "BROWN" IN COLOR AND WEIGHS 50 LBS I HAVE A "RABBIT" HIS NAME IS "BUNNY" BUNNY IS "WHITE" IN COLOR AND WEIGHS 10 LBS

This is a very simplified example of what I am trying to accomplish. Case sensitivity is not important, however, the quotation marks are. Any help you can give me in trying to figure this out would be greatly appreciated.

Posted by Aladin Akyurek on August 13, 2001 9:16 AM

Add a PROPER around Eric's formula to make the output readable though! (NT)

In F2 (copy down as needed) put the following ="I have a "&$F$1&A2&$F$1&" "&IF(D2="male","his","her")&" name is "&$F$1&B2&$F$1&" "&$F$1&B2&$F$1&" is "&$F$1&C2&$F$1&" in color, and weighs "&E2&" lbs" I had to do the "F1" finagling because the extra quote marks wouldn't go in the concatenation otherwise. Also I didnt know if you needed the output broken up on two different lines, so I chose the easier way. Hope that helps : I have a rather large spreadsheet which I need to convert to formatted text and save to an ascii text file. I have included a small example of what I am trying to accomplish: : cat kitty grey male 15 : dog doggie brown female 50 : rabbit bunny white male 10



Posted by Eric on August 13, 2001 9:33 AM

LOL! (NT)- thanks Aladin