Copy link to clipboard
Copied
Hi,
I import a list of names everyday from excel into indesign and would like to whittle the list down of people who are no longer with the company. Is there find/change command I can set up to delete the whole line that a certain name appears on? In the example below, is there a way to delete Rob's entire line (rob's line shows up in multiple spots so that is why I would prefer something I can run everyday rather than deleting it manually)? Since they are coming in from excel, each line ends with a paragraph break and the values are separated by tabs. Thank you in advance for any help you can give.
Joe 0 0 0
Tom 0 0 0
Rob 0 0 0
Ben 0 0 0
Mary 0 0 0
Oh, okay...and I think we are going about this in too complicated a manner. If you want their entire line erased, try this (for John Doe and Erica Gamet's info):
^(John Doe|Erica Gamet).+\r
Change to: leave blank
That says to delete John Doe's or Erica Gamet's info at the beginning of a line.
Copy link to clipboard
Copied
You could do a GREP expression. You have a series of non-breaking spaces and one spacebar space before each value. Try:
(Tom|Rob)~S{4} \d~S{4} \d~S{4} \d
And replace with nothing...you'll still have a hard return, though...which you could use the built-in multiple return to single return to clean that up.
Copy link to clipboard
Copied
Above, I did it for Tom and Rob's line both...just put all the names in that first group, separated by a 'pipe' for it to grab the names you want to delete.
Copy link to clipboard
Copied
Hi Erica,
Thank you so much for your quick response. I didn't realize Grep was the way to do it and that you would tailor your answer to my data. My data is actually a little different than my example. It's a first name and last separated by a space and then 10 more categories which are separated by tabs and have a different numerical value each day. For example:
John Doe(tab).000(tab).000(tab).000(tab)12(tab)3(tab)4(tab)54(tab)567(tab)0(tab)0(paragraph break)
Does that change the grep expression?
Copy link to clipboard
Copied
Replace the spaces in the provided grep with the grep tab command. Copy and paste the grep into the grep find box, delete a space and use the flout to insert the tab string. Do it to the other spaces.
Why isn't the excel file cleaned up so thus is even needed? If because it is now laid out, I would recommend doing it for the future.
Copy link to clipboard
Copied
^John Doe(\t[\d.]+){10}\r?
If you have a list [.txt] provided each day, as:
Erica Gamet
MW Design
Darth Vader
Duffy Duck
…
Do it in 1 click with a simple script [personally, not for free!]
(^/)
Copy link to clipboard
Copied
Oh, okay...and I think we are going about this in too complicated a manner. If you want their entire line erased, try this (for John Doe and Erica Gamet's info):
^(John Doe|Erica Gamet).+\r
Change to: leave blank
That says to delete John Doe's or Erica Gamet's info at the beginning of a line.
Copy link to clipboard
Copied
I couldn't edit my comment...I left off a ? at the end of that line...that makes sure if the name is the last one, it will also find it. Oops!
Copy link to clipboard
Copied
The power of Grep is its capacity given to users to define "patterns"! (Grep Jedi Bible)
Here, in French, we call that: "Taper en touche !"
(^/)
Copy link to clipboard
Copied
Thank you very much, everyone. I really appreciate the help.
Copy link to clipboard
Copied
If it's coming in via Excel why not do a Data Merge.
Copy link to clipboard
Copied
looks liek you have 4 colums, ad a fith and add a number 1 next to the name you want to remove, do a sort and than delete all of the 1?