OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Comments to separate column

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc
View previous topic :: View next topic  
Author Message
roronoaZoro
Newbie
Newbie


Joined: 06 Jun 2012
Posts: 1

PostPosted: Wed Jun 06, 2012 9:12 am    Post subject: Comments to separate column Reply with quote

I have one column that has many cells with comments in them. I want to create a separate column, and have all the comments move to that new column.

For example:

What I have:

Column 1

a (comment: small)
b (comment: big)
c (comment: medium)

What I need:

Col.1, Col. 2
a, small
b, big
c, medium
Back to top
View user's profile Send private message
jrkrideau
Super User
Super User


Joined: 08 Aug 2005
Posts: 6733
Location: Kingston ON Canada

PostPosted: Wed Jun 06, 2012 9:53 am    Post subject: Re: Comments to separate column Reply with quote

roronoaZoro wrote:
I have one column that has many cells with comments in them. I want to create a separate column, and have all the comments move to that new column.

For example:

What I have:

Column 1

a (comment: small)
b (comment: big)
c (comment: medium)

What I need:

Col.1, Col. 2
a, small
b, big
c, medium


I think we would have to see the exact data. If a, b c are the same length then some combination of LEFT or RIGHT() might do the trick

If each comment is in a () then doing something like exporting to csv format, addng a , to each line before the ( and reading the file back into Calc might be a good approach.
_________________
jrkrideau
Kingston ON Canada
Currently using Windows 7 & OOo 3.4.0 and Ubuntu 12.04 & LibreOffice 3.5.2.2
Back to top
View user's profile Send private message
DiGro
Super User
Super User


Joined: 02 Jun 2004
Posts: 1208
Location: Hoorn NH, The Netherlands

PostPosted: Wed Jun 06, 2012 10:18 am    Post subject: Reply with quote

You might want to use Text to columns in the menu Data when you have selected your column A

There you could give the ( as the delimiter or set a fixed width if thats better usable
_________________
DiGro

Windows 7 Home Premium and OOo 3.3 NL (Dutch)
Back to top
View user's profile Send private message
karolus
OOo Advocate
OOo Advocate


Joined: 22 Jun 2011
Posts: 208

PostPosted: Wed Jun 06, 2012 11:51 pm    Post subject: Reply with quote

Hallo

To return the Comment out of acell, use function:
Code:
function getAnno( sheet as integer , col as integer , row as integer ) as string
osheet = thisComponent.sheets().getByIndex( sheet -1 )
getAnno = osheet.getcellByPosition( col-1, row-1).getAnnotation().getString()
end function


Store it in a module below Standard-library, and call it from Calc for Example with:

Code:
=GETANNO( SHEET(A1) ; COLUMN(A1) ; ROW(A1) )


Karo
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group