| View previous topic :: View next topic |
| Author |
Message |
Economix Newbie

Joined: 15 Feb 2012 Posts: 4 Location: Bay Area
|
Posted: Wed Feb 15, 2012 5:42 pm Post subject: [SOLVED] Find & Replace absolute newbie question |
|
|
This is my first post and first "technical" issue with open office calc.
I am pre-processing a data file to submit to a machine-learning program. I have a "date" column that looks like
2008-01-03-23-49
0
2008-01-04-01-32
2008-01-04-02-13
0
0
-----etcetra--------
The etcetra is there because there are about 63000 observations (rows). I would like this "date" columns to look like
2008-01-03-23-49
?
2008-01-04-01-32
2008-01-04-02-13
?
?
-----etcetra--------
as the "?" is how the data mining software I will be using understands a "missing value". The problem is, when I use the Find & Replace method, I end up with
2??8-?1-?3-23-49
?
2??8-?1-?4-?1-32
2??8-?1-?4-?2-13
?
?
-----etcetra--------
which will be unacceptable by the data mining software. Any ideas of how I can get "surgical" with the Find & Replace method? Any help is appreciated...thanks!!
Edit: Not to mention, when I put 0 by itself into the Find field, even though I selected the column I wanted the changes performed on, it alters ALL of the 0s throughout my spreadsheet. Can I have it only do this to the column I select specifically?
Also, can anyone direct me to any resources specifically detailing the Find & Replace features, since I am sure I'll be making a heavy amount of use of this feature. Thanks again!
Last edited by Economix on Wed Feb 15, 2012 7:47 pm; edited 1 time in total |
|
| Back to top |
|
 |
JohnV Administrator

Joined: 07 Mar 2003 Posts: 8995 Location: Lexinton, Kentucky, USA
|
Posted: Wed Feb 15, 2012 6:30 pm Post subject: |
|
|
Find & Replace:
Search = ^0$
Replace = ?
Under More Option check Regular Expressions
Replace All |
|
| Back to top |
|
 |
Economix Newbie

Joined: 15 Feb 2012 Posts: 4 Location: Bay Area
|
Posted: Wed Feb 15, 2012 7:46 pm Post subject: |
|
|
Thanks JohnV! That was exactly what I was looking for...any idea about the addendum to my question? For now, I am going to scour this forum to see there are any other threads related to this question.
Thanks again! |
|
| Back to top |
|
 |
JohnV Administrator

Joined: 07 Mar 2003 Posts: 8995 Location: Lexinton, Kentucky, USA
|
Posted: Thu Feb 16, 2012 9:16 am Post subject: |
|
|
| Quote: | Can I have it only do this to the column I select specifically?
| Under More Options check Current Selection Only.
| Quote: | | Also, can anyone direct me to any resources specifically detailing the Find & Replace features | In the Find and Replace dialog click Help and look for the link, near the top, to List of Regular Expressions. Lots of posts here about how to use them.
Search = ^0$ means zero is the first character in the cell (or paragraph) and it is follow immediately by a carriage return (paragraph break) so it is the only character in the cell (or paragraph). |
|
| Back to top |
|
 |
Economix Newbie

Joined: 15 Feb 2012 Posts: 4 Location: Bay Area
|
Posted: Thu Feb 16, 2012 7:15 pm Post subject: |
|
|
Excellent!! Thanks once again, JohnV. You are very helpful. Since we're on this topic - I spent the greater part of today attempting to do one more alteration to my OOo data set. There exists a column which contains (in each of its cells) 2 words separated by a single space. Is there a way I can eliminate the space between them, thus creating a column of just one word in each of the cells?
I have tried using the Find & Replace methodology with Find: \n and Replace with: Replace all (I saw this in another thread I stumbled upon during my search). It didn't work, though.
Any ideas?? Thanks again! |
|
| Back to top |
|
 |
Economix Newbie

Joined: 15 Feb 2012 Posts: 4 Location: Bay Area
|
Posted: Thu Feb 16, 2012 7:55 pm Post subject: |
|
|
Well, I entered [:space:] in the "Find" field, and it worked, but I am not sure what to put in the replace field yet...maybe I'll try [:space:]{0} and see if it works...
[edit] It didn't work...but I changed [:space:]{0} to an empty field and it worked!!!
Thanks you JohnV!!! |
|
| Back to top |
|
 |
|