Skip to main content
Participating Frequently
October 22, 2009
Answered

What is Java code for "end of cell" "#" symbol?

  • October 22, 2009
  • 1 reply
  • 784 views

Thank you all up front!

I am trying to make a script to remove tabs and spaces from right before paragraph returns and end of table cells "#" symbols.

I can get the paragrahs (\r) to work, but I do not have a clue as to what the code is for the end of table cells # symbol.

Please help.

Bill Bernhardt

Doosan Publications

Old dog trying to learn new tricks!

This topic has been closed for replies.
Correct answer Peter Kahrel

Use the end-of-story marker, \Z:

app.findGrepPreferences.findWhat = "\\s+\\Z";

app.changeGrepPreferences.changeTo = "";

Peter

1 reply

Peter Kahrel
Community Expert
Peter KahrelCommunity ExpertCorrect answer
Community Expert
October 22, 2009

Use the end-of-story marker, \Z:

app.findGrepPreferences.findWhat = "\\s+\\Z";

app.changeGrepPreferences.changeTo = "";

Peter

Participating Frequently
October 22, 2009

Peter,

Thanks! That worked.

I had tried the "\s+\Z"    ""

not the "\\s+\\Z"  ""

So what role does the extra \  do in the script?

Larry G. Schneider
Community Expert
Community Expert
October 22, 2009

A back slash (\) is a reserved character in JS and GREP so in order to use it as an ordinary character you need to escape it (preceed it with another back slash).