Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

GREP help

Explorer ,
May 22, 2014 May 22, 2014

Hi,

I am new to GREP and cannot figure out how to make this work:

I scan some pages and often the same mistake occurs:

The scanner mistakes "1" for "I". (Capital i)

Where it shoud say "1. december" it says "I. december"

"10. januar" becomes "I0. januar"

"2014" becomes "20I4" - would be nice to make a GREP search here I think.

I hope that someone can help me.

Anita

TOPICS
Scripting
560
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , May 22, 2014 May 22, 2014

Hi Mary,

It doesn't miss it: I don't try to treat it. I treat the 2 other cases. But I"ve seen a bug.

This treats all:

Search:  (?<=\d)I|I(?=\d)|(?<=I)I|I(?=I)|I(?=\.)

Change to:  1


But you'll need to launch it 2 times! 


Yours forget more if you want to treat, eg:  I0I  /  20II  /  201,15  /  II.  /  III …


I"ve not limited the research to the dates!

Translate
LEGEND ,
May 22, 2014 May 22, 2014

Hi,

As I suppose you want to do it at the beginning of your work, you need to go to the washing machine.

About the first problem, it's easy. The following are more interesting. I treat it as:


Search:  (?<=\d)I+|I+(?=\d)

Replace by:  1

Difficult to find: "I've liked II with George Clooney!" 

... but you can extend the research with a global grep style to find this type of occurrence.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 22, 2014 May 22, 2014

Tried your example, Obi-wan, but it misses the first instance since there is no digit before "I. december".

Anita, try this and see if it works for you:

Find what: I((?=\.)|(?=\d))

Change to: 1

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 22, 2014 May 22, 2014

Hi Mary,

It doesn't miss it: I don't try to treat it. I treat the 2 other cases. But I"ve seen a bug.

This treats all:

Search:  (?<=\d)I|I(?=\d)|(?<=I)I|I(?=I)|I(?=\.)

Change to:  1


But you'll need to launch it 2 times! 


Yours forget more if you want to treat, eg:  I0I  /  20II  /  201,15  /  II.  /  III …


I"ve not limited the research to the dates!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 23, 2014 May 23, 2014
LATEST

Thanks Mary and Obi Wan,

I found that Obi Wan's search does the trick. Amazing - thanks a lot for your help.

Anita

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines