Rushat Rai
Rushat Rai

Reputation: 793

Is it possible to remove characters before a certain point?

I want to delete a set of characters which are behind a backslash in LibreOffice Calc. For example:

My/Name
Is/Jeff

where I would like to delete My and Is such that only /Name and /Jeff remain.

Does Libre's inbuilt functionality allow something like this or will I need to write some sort of script?

Upvotes: 4

Views: 9498

Answers (2)

Axel Richter
Axel Richter

Reputation: 61915

Libreoffice/Openoffice Calc Find&Replace is able using regular expressions.

So you can search for ^.*\/ = from start of line, all kinds of characters until last occurrence of slash...

and replace that with nothing:

enter image description here

Or if only till first occuring of slash and if the slash shall be remaining, then you can search for ^[^\\\/]* = from start of line, all kinds of characters except slash...

and replace that with nothing:

enter image description here

Upvotes: 2

Jim K
Jim K

Reputation: 13819

Use this formula:

=RIGHT(A1, LEN(A1) - FIND("/", A1))

Breakdown:

  • RIGHT(A1): take the righthand side of the string in A1
  • LEN(A1): count the number of characters in A1
  • FIND("/", A1): get the position of slash in A1

In other words, count all the characters and subtract the position of the slash. That's how many characters we grab starting from the right-hand side.

Upvotes: 6

Related Questions