|
|||||||
| Shooting The Shit Anything goes, seriously. Come meet and network with your peers, it's a fun way to take a break out of your busy day of posting at other boring forums. |
|
Welcome to the WickedFire - Affiliate Marketing Forum - Internet Marketing Webmaster SEO Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
it's a wig
|
deletes entire ROWS that contain a certain keyword anywhere in the row(not just cell contents)
anyone know if this function exists and what it's called?
__________________
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam cursus. Morbi ut mi. Nullam enim leo, egestas id, condimentum at, laoreet mattis, massa. |
|
|
|
|
#2 (permalink) |
|
Member
|
Sounds more database-y than excel-esque - could you import it into access/other database?
Long story short, not many functions can edit cells other than themselves, so deleting a row doesn't sound like a function thing. I know nothing about macros, but you/someone might, and I assume they could do the job. Another alternative; export as CSV, write a quick program in your language of choice to do the dirty work, open up again in excel. |
|
|
|
|
#3 (permalink) |
|
Banned
|
I second the CSV. One line of PHP along the lines of:
Your CSV: Column1,Column2,Column3 PHP: preg_replace('/\b,\b,YourValue.*?$/',"",file_get_contents($file)); In english: Search for a word, a comma, YourValue optionally followed by other things, as many of them as you'd like, until the end of the line. This is untested, but should be close.
__________________
SEO Keyword Tracking For Professionals (Or just a slob with clients) How To Write Link Bait Stop moving in slow motion:Full Speed SEO |
|
|
|
|
#4 (permalink) |
|
Banned
|
Im feeling generous.
Here is your code, tested. <?php $g = "23,245,34\n35,23,12\n45,45,45"; $g = preg_replace("/\d*,\d*,45$/","",$g); $g = "Joe,Jim,Rob\nJosh,Jon,Tom\n"; $g = preg_replace("/\w.*,\w.*,Rob/","",$g); echo $g; ?> The one caveat is it leaves blank lines where the old ones were, but that wont show up when you re-import to excel.
__________________
SEO Keyword Tracking For Professionals (Or just a slob with clients) How To Write Link Bait Stop moving in slow motion:Full Speed SEO |
|
|
|
|
#5 (permalink) |
|
Banned
|
Wait. Anywhere in the row?! Stand by...
__________________
SEO Keyword Tracking For Professionals (Or just a slob with clients) How To Write Link Bait Stop moving in slow motion:Full Speed SEO |
|
|
|
|
#6 (permalink) |
|
Banned
|
This is dirty, but it works.
$g = preg_replace("/(.*?)Rob(.*?)?/","",$g);
__________________
SEO Keyword Tracking For Professionals (Or just a slob with clients) How To Write Link Bait Stop moving in slow motion:Full Speed SEO |
|
|
|
|
#7 (permalink) |
|
Banned
|
Ok, that actually breaks if Rob starts the line. This works, but again, dirty.
$g = preg_replace("/^(.*?),?Rob,?(.*?)\n/","",$g); Which in english reads: If you have a start of the line, Followed by anything, then an optional comma (So in case we're first column) Then our search term Rob Followed by an optional comma (In case were last row) followed by anything until the line break, replace it with nothing. Sorry about all the posts, but I cant edit after 10 mins. Please let me know how this works for you, I've spent some time on it, and the payoff will be hearing your results.
__________________
SEO Keyword Tracking For Professionals (Or just a slob with clients) How To Write Link Bait Stop moving in slow motion:Full Speed SEO |
|
|
|
|
#11 (permalink) | |
|
^^^ Bi-Winning ^^^
|
nice move
__________________
"Concentrated power has always been the enemy of liberty" ~ Ronald Reagan Quote:
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| IP Geo Targeting Function | Brad101 | Design, Development & Programming | 12 | 03-25-2008 12:45 AM |
| Significance of backlinks with "link:" function on Google? | Aveligand | Newbie Questions | 1 | 02-13-2008 08:05 AM |
| php function for splitting text? | Stanley | Design, Development & Programming | 2 | 11-16-2007 05:49 PM |
| Excellent PHP Tips/Tricks/Techniques To Follow | Aequitas | Design, Development & Programming | 47 | 10-16-2007 07:46 PM |
| Coding needed - on page search function | nachoninja | Design, Development & Programming | 0 | 08-04-2007 09:20 PM |