Finding single words followed by '

So I have a csv with cells in the first column. Many of the cells contain a lot of text, and many of the cells are empty. But the cells we are concerned about contain only one word immediately followed by an apostrophe.

Is there a way to find these and move them to the same row in the second column?

Cheers

Supposing your “csv” is loaded into a spreadsheet under LibreOffice

Finding the relevant cells is simple with the help of a RegularExpression: Select the column, call Find&Replace (Ctrl+H by default in recent versions), enable Regular expressions, enter ^\w+'$ behind Find: and click Find All
But spreadsheets don’t support a move command for non-adjacent SheetCellRanges.
If you insist on getting this functionality you will need to write user code.
The other way is to enter a “selective formula” into all the cells of column B down to the last cell where coumn A can contain something.
The formula should be =IFERROR(REGEX(A2; "^\w+'$";;1);"") .
You may later copy the range of results and use Paste Special.. to get the results without the formulas.
Both ways are demonstrated in the attached example.
disask93298FullService.ods (17.4 KB)
To see the user code working, you need to permit document macros exceptionally. (Never do so without checking the code for probably malign parts.)

1 Like

Cool that seems to be doing the thing I was hoping for. So thanks!

When I try to paste the contents of my column it says “There is not enough space on the sheet to insert here.”

That did the trick, thanks!