find

removing extensions in subdirectories

I need to remove the extension ".tex": ./1-aoeeu/1.tex ./2-thst/2.tex ./3-oeu/3.tex ./4-uoueou/4.tex ./5-aaa/5.tex ./6-oeua/6.tex ./7-oue/7.tex Please, do it with some tools below: Sed and find Ruby Python My Poor Try: $find . -maxdepth 2 -name "*.tex" -ok mv `sed '[email protected]@@g' {}` {} + ...

what is wrong with find . | xargs grep '...'?

When i use the command above, i get wrong matches.....can someone explain me, what is wrong? I'm trying to search for the string "..." in all files in the current folder. ...

jQuery wildcard search

I'm trying to find all elements on a page whose element ID contains a certain text. I'll then need to filter the found elements based on whether they are hidden or not. Any help is greatly appreciated. ...

Show next set of results in page with Rails, like Facebook-style "older posts" link to see next set of news items

I'm still pretty new to Rails and need your help: I have been creating a social fitness analytics site (zednine.com) that has an activity stream that lists workouts posted on the site. Several pages currently show the 10 most recently updated workouts. I'd like to add a link at the bottom to "Older workouts." On click, this should show t...

Is there a way to find an object's properties in List<T> using Contains?

Hi guys I was wandering how can I find out if an object already exists in my List. I'm adding "newPerson" (instance of Person class) in a List, but checking if newPerson contents/properties exists or not in the List. This piece works fine: List<Person> people = this.GetPeople(); if (people.Find(p => p.PersonID == newP...

Quickest way to find substrings in text files

What's the fastest way to find strings in text files ? Case scenario : Looking for a particular path in a text file with around 50000 file paths listed (each path has it's own line). ...

Shell script to find out if two files from a list of files are created on the same day

Hi I would like to find out using a korn shell script if two files from a list of files are created on the same day. I need to check the current file against the previous file in the list to see if they are created on the same day. Can someone please help? ...

TreeNodeCollection.Find Doesnt seem to work

When i hit the assert i was surprise bc i expected my implementation to be correct. It should work but didnt so i wrote the code below and comment out the assert and find. Why does my code work and find does not? var z = n.Find(v[i], false); //Debug.Assert(z.Count() == 1); //n = z[0].Nodes; ...

git find fat commit

Is it possible to get info about how much space is wasted by changes in every commit — so I can find commits which added big files or a lot of files. This is all to try to reduce git repo size (rebasing and maybe filtering commits) ...

Find line in text file, check for text in between?

Question about Batch/Windows/CMD: I would like that my batch file can search for a line (which I already achieved, but what comes next not), it looks like this: <name>MyName</name> It needs to find the text in between <name> and </name>. After that it needs to set that as a variable (%name%). Does anyone have any idea? EDIT: if som...

To count a character in files by Find/Xargs/Sed

How can you count the number of the character < in your files? I am trying to count the number of the character "<" in my files, similarly as in Vim by %s/<//gn I run find * -type f | xargs sed 's/<//gn' I get sed: -e expression #1, char 7: unknown option to `s' This error suggests me that Vim's :s -mode is not like SED. ...

Selecting items in a combobox and removing them

Hi, I want to find an Index of a combobox using numbers in the text of a textbox, and then remove them. The items that populate the combobox belong to a data base so I use the Delete method to remove the rows. EDITED: I've been reading and the findstring finds text within the item list, not the index. Is there anyway to look for the ...

Cucumber: rails dynamic find not working in paths.rb

I am working on rails with rspec, rspec-rails, cucumber and webrat. I am trying to learn BDD and testing in general. I have a cucumber scenario like this: Scenario: Questions List Given quiz titled "Pearl Jam" has questions named "Corduroy, Dissident" When I go to the experiment page for quiz titled "Pearl Jam" Then I shou...

Jquery find() taking too much time in IE

I am trying to find HTML inside a DIV in the Ajax HTML response: $j(responseText).find("#my_DIV").html() This works perfectly in FF but IE6 seems to hang and wait forever for the find() to finish, is there a work around to finding a DIV or is there something I am doing wrong? ...

Finding a string in a string

Hi, Does anyone know a nice efficient way of finding a string within a string (if it exists) in objective c for iPhone Development, I need to find the part of the string in between two words, e.g. here I need to find the co2 rating number in the string, where z is the value I'm looking for ... xxxxxco_2zendxxxxxxx Thanks Richard www...

Why does "find . -name *.txt | xargs du -hc" give multiple totals?

Hi All, I have a large set of directories for which I'm trying to calculate the sum total size of several hundred .txt files. I tried this, which mostly works: find . -name *.txt | xargs du -hc But instead of giving me one total at the end, I get several. My guess is that the pipe will only pass on so many lines of find's output at...

Adding find condition to all Active Record Models in Rails

Is there anyway to add a find condition to all Active record models? that is I would like this query ExampleModel.find :all, :conditions=> ["status = ?", "active"] to behave the same way as ExampleModel.find :all in every model Thanks!! ...

UNIX find for finding file names NOT ending in specific extensions?

Is there a simple way to recursively find all files in a directory hierarchy, that do not end in a list of extensions? E.g. all files that are not *.dll or *.exe UNIX/GNU find, powerful as it is, doesn't seem to have an exclude mode (or I'm missing it), and I've always found it hard to use regular expressions to find things that don't m...

To make an action based on the link location by jQuery

How can you retrieve the value of the rel attribute of a given link and pass it to the handler? I have a list of links such that Link list <div id='one_answer'>Answer1 <a href="$" class="delete_answer" rel='Answer1'>delete</a> </div> <div id='one_answer'>Answer2 <a href="$" class="delete_answer" rel='Answer2'>delete</a> </div>...

Using JQuery to activate a popup using image name.

Hey guys, I am trying to use JQuery to manage some popups. This page I am building will have 15 projects, each which is a thumbnail contained within a DIV. Each DIV has a Name attribute so I would like to have JQuery find the name of the DIV and activate the hidden popup with the same name that is contained within the ID… Currently I ha...