Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I have a big distribution list that I need to edit and remove some names that are with other departments
For example I need to remove all names that have zzz in them
Ex "zzzlastname, first name: acronym;"I am unable to delete the whole name with the acronym.
I am using word with the find and replace option if I specify to find zzz and replace it with nothing of course it will remove the zzz but not the whole name
All names are separated by ;
SO using the wild card option I say <;zzz>;
but it does not find any thing
I have word, Word perfect, excel available
Does anyone know the exact syntax?Thanks
Eric

Google for change.com.
"Windows 95 /n./ 32 bit extensions and a graphical shell for a 16 bit patch to an 8 bit operating system originally coded for a 4 bit microprocessor, written by a 2 bit company that can't stand 1 b

So the line is:
zzzlastname, first name: acronym;
Is that right?
And it needs to be changed to:
acronym;
=====================================
If at first you don't succeed, you're about average.M2

If you want to remove the entire line containing the string, try this:
::== chop.bat
@echo off > newfile
set /p chop= string to chop out ?
for /f "tokens=*" %%T in (mydata) do (
echo %%T | find /v "%chop%" >> newfile
)
:: DONE
=====================================
If at first you don't succeed, you're about average.M2

If the name is in a list occurring on a separate line and you want to remove the extire line, use a macro. First find the desired string, go the beginning of the line,
block mark on, go to end of line, delete line, search for next and repeat. This method works in Word Perfect for DOS (and should work in others).

Get your list into Excel and use
=LEFT(B1,3) in column A if your list is in column B
The rest should be easy

[quote]from Mec
So the line is:zzzlastname, first name: acronym;
Is that right?
And it needs to be changed to:
acronym;
[\quote]Correct
What I need to do is to remove the recipients’ from a certain acronym
Like I said before I tried to use word to find the acronym and replace it with nothing but it will not pick up the name, also since all e-mail addresses are separated by ; I thought there would be some wild cards I could use that would work
Thanks

>> since all e-mail addresses are separated by ; I thought there would be some wild cards I could use that would work
Does that mean that you are tring to search for and edit lines that have email addresses?
Perl or sed would be your best choice for doing the edit, but I don't have a clear picture of the format of your data and exactly what you need to accomplish.
Can you post a few lines of your file for us to work with that are not obfuscated?

Here is what I have:
;Brenan, Norm: #CIO - BPI; Brise, Eric: #CIO-BPI; Bunts, Dan: #LEG;
For example I want all name that have the acronym CIO removed from the list

Do you want the entire line removed or just the CIO acronym removed from the line?
If you want to edit the line, but not completely remove it, what do you want it to look like after the edit?

I think what is wanted is to remove all of the entry if it contains the acronym. From the character after the first preceeding semicolon up to an including the next semicolon. Some form of script processor or a dedicated program would probably give the best results. Areas to consider, entry is the first item in list (no leading semicolon), entry is last item in list (no following semicolon), entry spans multiple lines (can the program using the amended list handle long lines).

As usual, a clear problem statement is at least 49% of the job.
=====================================
If at first you don't succeed, you're about average.M2

tobike hasn't given a clear description of what needs to be done, but assuming all lines that have CIO are to be removed, here's a simple Perl command line solution.
perl -ni.bak -e "print if ! /\bCIO\b/" db.txt
If the line needs to be edited rather than removed, the command would be similar. The main difference would be in the construction of the regex (regular expression).

Sorry if it was not clear enough
Kind of hard to explain problems sometimes
Wizardfred read it right and it is what I wanted to do
I did achieve it with a simple word editing software which was notepad plus.Thanks

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |