How can I distinguish ß (Sharp s) and ss with 'basic macro'
How can I distinguish ß (Sharp s) and ss with 'basic macro'
German letters were created while automatically converting pdf documents to docs.
Unfortunately, I was unable to distinguish between ß (Sharp s) and ss while doing other operations using macros.
I am looking for a way to avoid this. I have encountered 'basic macro' today.
I am doing the following work.
oReplace.setSearchString ("ß") 'Please do not change "ss"
oReplace.setReplaceString ("fl")
oReplace.SearchRegularExpression = True 'Use regular expressions
oReplace.searchAll = True 'Do the entire document
oDoc.replaceAll (oReplace)
Unfortunately, I was unable to distinguish between ß (Sharp s) and ss while doing other operations using macros.
I am looking for a way to avoid this. I have encountered 'basic macro' today.
I am doing the following work.
oReplace.setSearchString ("ß") 'Please do not change "ss"
oReplace.setReplaceString ("fl")
oReplace.SearchRegularExpression = True 'Use regular expressions
oReplace.searchAll = True 'Do the entire document
oDoc.replaceAll (oReplace)
LibreOffice 4.2.8.2
- Sébastien C
- Posts: 111
- Joined: Mon Jan 04, 2010 5:06 pm
- Location: Meymac, France
Re: How can I distinguish ß (Sharp s) and ss with 'basic mac
Hello billylee and welcome on this forum,
I am not sure to understand your question. But it is true that if we search “ß” in a document LibreOffice found characters string “ss”
It is a same problem with single long s (old typography) that I know so well...
You have for that to specify to respect the case sensitive.
Viele Gruße
I am not sure to understand your question. But it is true that if we search “ß” in a document LibreOffice found characters string “ss”
It is a same problem with single long s (old typography) that I know so well...
You have for that to specify to respect the case sensitive.
Code: Select all
oReplace.setSearchString ("ß") 'Please do not change "ss"
oReplace.setReplaceString ("fl")
oReplace.SearchCaseSensitive = True ' Set the case sensitive
oReplace.SearchRegularExpression = True ' Use regular expressions
oReplace.searchAll = True 'Do the entire document
oDoc.replaceAll (oReplace)
LibreOffice v. 7.3.2.2, under GNU-Linux Mint and, in virtualization and just for tests, LibreOffice v. 7.3.2.2 an OpenOffice v. 4.1.12 under M$-W 10 .
Re: How can I distinguish ß (Sharp s) and ss with 'basic mac
Thank you for answer.
My question is that "ss" changes while changing "ß". I do not need the letter ß at all. In Asia, I do not use German a lot.
My question is that "ss" changes while changing "ß". I do not need the letter ß at all. In Asia, I do not use German a lot.
LibreOffice 4.2.8.2
Re: How can I distinguish ß (Sharp s) and ss with 'basic mac
Do it like the Swiss do. They abolished all uses of ß in favour of ss. Just perform a simple find/replace. No macro code required.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
- Sébastien C
- Posts: 111
- Joined: Mon Jan 04, 2010 5:06 pm
- Location: Meymac, France
Re: How can I distinguish ß (Sharp s) and ss with 'basic mac
@billylee
If you are not in a macro context (I mean if your code is not include in a code that you use yet), Villeroy say right : just perform a simple find/replace. But if you are in a macro context, the code can be there:
@Villeroy
We do not know the context where billylee is! I can talk for my self about the long S witch it has been abolished in France since the end of the eighteenth century; and it is not for the sake of it that the question of transcribing it in a historical context cannot be posted in this forum!
There are even places where one gets here or there a specialty that LibreOffice solves!
Similarly, if billylee asks to make a change in macro, it is because he is probably in such a context!
If you are not in a macro context (I mean if your code is not include in a code that you use yet), Villeroy say right : just perform a simple find/replace. But if you are in a macro context, the code can be there:
Code: Select all
Sub byBySharpS
Dim oReplace As Object
oReplace = thisComponent.CreateReplaceDescriptor()
oReplace.setSearchString ("ß") '
oReplace.setReplaceString ("ss")
oReplace.SearchCaseSensitive = True ' Set the case sensitive
oReplace.SearchRegularExpression = True ' Use regular expressions
oReplace.searchAll = True ' Do the entire document.
thisComponent.replaceAll (oReplace)
End Sub
We do not know the context where billylee is! I can talk for my self about the long S witch it has been abolished in France since the end of the eighteenth century; and it is not for the sake of it that the question of transcribing it in a historical context cannot be posted in this forum!
There are even places where one gets here or there a specialty that LibreOffice solves!
Similarly, if billylee asks to make a change in macro, it is because he is probably in such a context!
LibreOffice v. 7.3.2.2, under GNU-Linux Mint and, in virtualization and just for tests, LibreOffice v. 7.3.2.2 an OpenOffice v. 4.1.12 under M$-W 10 .
Re: How can I distinguish ß (Sharp s) and ss with 'basic mac
Thank you for your answers. My job is to edit many documents. So I need macro function.
If my document is not a binary document but text, I can simply do the following:
sed -i "s / ß / fl / d" * .doc
One hint is that the "match case" checkbox provided by Openoffice distinguishes between two characters.
If my document is not a binary document but text, I can simply do the following:
sed -i "s / ß / fl / d" * .doc
One hint is that the "match case" checkbox provided by Openoffice distinguishes between two characters.
LibreOffice 4.2.8.2
- Sébastien C
- Posts: 111
- Joined: Mon Jan 04, 2010 5:06 pm
- Location: Meymac, France
Re: How can I distinguish ß (Sharp s) and ss with 'basic mac
So, if I resume your desire (because I do not understand yet well), you searching a macro for:
make an inventory of the name’s files for a complete directory.
make an inventory of the name’s files for a complete directory.
- open each file.
- search and replace the “ß” character by “fl”.
- close each file.
LibreOffice v. 7.3.2.2, under GNU-Linux Mint and, in virtualization and just for tests, LibreOffice v. 7.3.2.2 an OpenOffice v. 4.1.12 under M$-W 10 .
Re: How can I distinguish ß (Sharp s) and ss with 'basic mac
Hello. What I want is a script-level behavior that does not involve people needing to open, close, or click on a file. Let's say the document is 10,000. The most fundamental cause of this problem is that Openoffice can not distinguish between two letters. (Default mode). Maybe it does not seems to be resolved.
And as already mentioned
"My problem is that "ss" is also changed while changing "ß".
Lastly, the intention is not to solve this problem, but to let you know that this problem exists.
Thank you.
And as already mentioned
"My problem is that "ss" is also changed while changing "ß".
Lastly, the intention is not to solve this problem, but to let you know that this problem exists.
Thank you.
LibreOffice 4.2.8.2
- Sébastien C
- Posts: 111
- Joined: Mon Jan 04, 2010 5:06 pm
- Location: Meymac, France
Re: How can I distinguish ß (Sharp s) and ss with 'basic mac
I really do not understand.billylee wrote:My problem is that "ss" is also changed while changing "ß".
If I check the "match case" in my LibreOffice, it is not happening like you describe; “ss” is preserved. Do you really work on LibreOffice 4.2.8.2 as you say in signature or OpenOffice?
LibreOffice v. 7.3.2.2, under GNU-Linux Mint and, in virtualization and just for tests, LibreOffice v. 7.3.2.2 an OpenOffice v. 4.1.12 under M$-W 10 .
Re: How can I distinguish ß (Sharp s) and ss with 'basic mac
There is not a single developer on this forum. Bugs have to be reported to the bug tracker.
I don't understand the problem neither.
I don't understand the problem neither.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice