Hi everybody, I have a document with a list of 4000 drug names. However some of the names are very similar such as:
Metoprolol
Metoprolol Succinate
Metoprolol Tartrate
How can I remove duplicated or similar entries please?
Dropbox link:
https://www.dropbox.com/s/cryvzoupliw3p ... 2.odt?dl=0
How to delete duplicate words?
How to delete duplicate words?
OpenOffice 4.1.3 on Windows 10
Re: How to delete duplicate words?
While a certain amount of automatic tidying up may be possible, it is likely to have unwanted side-effects in the assumption that certain entries of similar name are related and hence "duplicates" to be deleted.
Consider the following (from the list)
To my (now rusty) chemical knowledge, several of these are very different. If the removal is based on name matching up to a length, how is the removal method to know that "Sodium Acetate" and "Sodium Lactate" are different. In other words, what criteria do you suggest for removal of "duplicates"?
Consider the following (from the list)
Code: Select all
Sodium Acetate
Sodium Bicarbonate
Sodium Ferric Gluconate
Sodium Fluoride
Sodium Hyaluronate
Sodium Iodide I 131
Sodium Lactate
Sodium Oxybate
Sodium Phenylbutyrate
Sodium Phosphate Monobasic
Sodium Polystyrene Sulfonate
Sodium Sulfacetamide
Apache OpenOffice 4.1.15 on Xubuntu 22.04.5 LTS
Re: How to delete duplicate words?
Hi, thanks for replying. I actually just want to use them as fictional names for roleplaying games such as Dungeons & Dragons. So I'm just looking to remove duplicates.
OpenOffice 4.1.3 on Windows 10
Re: How to delete duplicate words?
Edit > Find and Replace
Click More > tick Regular Expressions
Find (.*)( ) (.*)
Replace $1
click Replace All
... will delete everything after the first space in a name. You may need to do it several times if you have drug names with more than one space.
Find (.* )(.*)
Replace zzzz
... will replace any "name followed by a space" with zzzz. Sort (perhaps using a spreadsheet) and all the zzzz will be sorted last, leaving just one instance of the first word in the name in rest of the the list.
See [Hint] How to record a macro (and Regular Expressions) for an explanation of Regular Expressions.
Click More > tick Regular Expressions
Find (.*)( ) (.*)
Replace $1
click Replace All
... will delete everything after the first space in a name. You may need to do it several times if you have drug names with more than one space.
Find (.* )(.*)
Replace zzzz
... will replace any "name followed by a space" with zzzz. Sort (perhaps using a spreadsheet) and all the zzzz will be sorted last, leaving just one instance of the first word in the name in rest of the the list.
See [Hint] How to record a macro (and Regular Expressions) for an explanation of Regular Expressions.
LO 6.4.4.2, Windows 10 Home 64 bit
See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.
Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.
Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
-
- Posts: 4
- Joined: Thu Dec 01, 2016 5:06 pm
Re: How to delete duplicate words?
Find & Replace
Searches for or replaces text or formats in the current document.
To access this command...
Choose Edit - Find & Replace
Ctrl+F
On Standard bar, click
Find & Replace
Search For
Enter the text that you want to search for, or select a previous search from the list.
Search options are listed in the Options area of the dialog
Replace With
Enter the replacement text, or select a recent replacement text or style from the list.
Replacement options are listed in the Options area of the dialog.
Options
Whole words only
Searches for whole words or cells that are identical to the search text.
Backwards
Search starts at the current cursor position and goes backwards to the beginning of the file.
Regular expressions
Allows you to use wildcards in your search.
List of Regular Expressions
Match case
Distinguishes between uppercase and lowercase characters.
Current selection only
Searches only the selected text or cells.
Search for Styles / Including Styles
Searches for text formatted with the style that you specify. Select this checkbox, and then select a style from the Search for list. To specify a replacement style, select a style from the Replace with list.
After you select the attributes that you want to search for, the Search for Styles box in the Options area of the OpenOffice Writer Find & Replace dialog changes to Including Styles.
If you want to search for text in which attributes were set by using direct formatting and styles, select the Including Styles box.
Comments
In Writer, you can select to include the comment texts in your searches.
Searching for Attributes
Similarity Search
Find terms that are similar to the Search for text. Select this checkbox, and then click the ... button to define the similarity options.
Match character width (only if Asian languages are enabled)
Distinguishes between half-width and full-width character forms.
Sounds like (Japanese) (only if Asian languages are enabled)
Lets you specify the search options for similar notation used in Japanese text. Select this checkbox, and then click the ... button to specify the search options.
Searching in Japanese
Find All
Finds and selects all instances of the text or the format that you are searching for in the document (only in Writer and Calc documents).
Find
Finds and selects the next occurrence of the text or format that you searching for in the document.
Replace All
Replaces all of the occurrences of the text or format that you want to replace.
Replace
Replaces the selected text or format that you searched for, and then searches for the next occurrence.
Attribute
Choose the text attributes that you want to search for. For example, if you search for the Font attribute, all instances of text that do not use the default font are found. All text that has a directly coded font attribute, and all text where a style switches the font attribute, are found.
Format
Finds specific text formatting features, such as font types, font effects, and text flow characteristics.
No Format
Click in the Search for or the Replace with box, and then click this button to remove the search criteria based on formats.
Searches for or replaces text or formats in the current document.
To access this command...
Choose Edit - Find & Replace
Ctrl+F
On Standard bar, click
Find & Replace
Search For
Enter the text that you want to search for, or select a previous search from the list.
Search options are listed in the Options area of the dialog
Replace With
Enter the replacement text, or select a recent replacement text or style from the list.
Replacement options are listed in the Options area of the dialog.
Options
Whole words only
Searches for whole words or cells that are identical to the search text.
Backwards
Search starts at the current cursor position and goes backwards to the beginning of the file.
Regular expressions
Allows you to use wildcards in your search.
List of Regular Expressions
Match case
Distinguishes between uppercase and lowercase characters.
Current selection only
Searches only the selected text or cells.
Search for Styles / Including Styles
Searches for text formatted with the style that you specify. Select this checkbox, and then select a style from the Search for list. To specify a replacement style, select a style from the Replace with list.
After you select the attributes that you want to search for, the Search for Styles box in the Options area of the OpenOffice Writer Find & Replace dialog changes to Including Styles.
If you want to search for text in which attributes were set by using direct formatting and styles, select the Including Styles box.
Comments
In Writer, you can select to include the comment texts in your searches.
Searching for Attributes
Similarity Search
Find terms that are similar to the Search for text. Select this checkbox, and then click the ... button to define the similarity options.
Match character width (only if Asian languages are enabled)
Distinguishes between half-width and full-width character forms.
Sounds like (Japanese) (only if Asian languages are enabled)
Lets you specify the search options for similar notation used in Japanese text. Select this checkbox, and then click the ... button to specify the search options.
Searching in Japanese
Find All
Finds and selects all instances of the text or the format that you are searching for in the document (only in Writer and Calc documents).
Find
Finds and selects the next occurrence of the text or format that you searching for in the document.
Replace All
Replaces all of the occurrences of the text or format that you want to replace.
Replace
Replaces the selected text or format that you searched for, and then searches for the next occurrence.
Attribute
Choose the text attributes that you want to search for. For example, if you search for the Font attribute, all instances of text that do not use the default font are found. All text that has a directly coded font attribute, and all text where a style switches the font attribute, are found.
Format
Finds specific text formatting features, such as font types, font effects, and text flow characteristics.
No Format
Click in the Search for or the Replace with box, and then click this button to remove the search criteria based on formats.
OpenOffice 4.1.3 installed on Windows 7 OS