Ask Your Question
0

New to regex [closed]

asked 2015-09-02 05:28:25 +0100

lwizardl gravatar image

I am new to using regular expressions in LibreOffice Calc. What I am trying to figure out how to do is the following I have a list of various titles and one of the columns has "Regions Released", some of the contents of that column has a few different entries. "NA, JP, PAL, BR" etc. What I was wondering how to do is I want to take that content and have it create a new column for each of those.

I have took a small section of the tables and did a example of how I would like it to look finished.

image description

in the above image You can see the first row is the titles for the columns, the next row starts the data. If the title was released in the region I would like it to mark an yes into the new columns. Looking at the F3 field you can see it says NA and nothing else. So the NA column would get a Yes while the others are left blank.

Would this type of thing be able to be done using Regex? I am currently doing it all by hand and some of the lists I have are for 400+ rows and would very much prefer a quicker way to do it all.

Thanks

James

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2016-03-17 21:00:14.158678

1 Answer

Sort by » oldest newest most voted
0

answered 2015-10-06 00:22:29 +0100

Alex Kemp gravatar image

updated 2015-10-12 04:07:00 +0100

Hi lwizardl

There's no need to use a regex for that task. Use one of these as your function (this is for the NA column; change other columns as appropriate):

  • =IF(ISNUMBER(FIND("NA", $A2)), "YES", "") (case-sensitive)
  • =IF(ISNUMBER(SEARCH("NA", $A2)), "YES", "") (case-insensitive)
    image description

demo-calc.ods

If this helps then please tick the answer (✔)
...and/or show you like it with an uptick ()

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-09-02 05:28:25 +0100

Seen: 96 times

Last updated: Oct 12 '15