Questions tagged [find]

This tag has multiple meanings. Please DO NOT use this tag if you're just trying to find something.

find is:

  1. a filesystem search tool on various flavors of *nix,
  2. a filesystem search tool on various flavors of DOS and Windows,
  3. the name of a jQuery method,
  4. the name of a family of methods in ActiveRecord,
  5. a function in the C++ standard library,
  6. a method of strings in Python,
  7. a method of Matcher Class in Java.
  8. a method in many different NoSQL's to find documents in a collection.
11183 questions
3
votes
3 answers

C# Array.FindIndex index of current object

I'm doing my school homework which is just a basic programming exercise, and at the minute I'm stuck. I tried to solve everything as simple and as elegant as possible, whereas my classmates just used a bunch of for loops, which I consider…
Tigris
  • 119
  • 1
  • 8
3
votes
2 answers

List Find method in C++/CLI

Why it doesn't work in C++/CLI ? _list->Remove(_list->Find(x => x.Inode == 2)); I received an error error C2065: 'x' : undeclared identifier
Artem Kyba
  • 855
  • 1
  • 11
  • 30
3
votes
3 answers

Find part of vector in another vector matlab

I would like to know if there is an easy way to find the indices of a vector in another vector in matlab: a = [1 2 3 5 7 10 2 3 6 8 7 5 2 4 7 2 3] b = [2 3] So how to get the indices of a when comparing it with b (index of first element is…
Krus
  • 83
  • 2
  • 10
3
votes
3 answers

Anagram solver in C++

I am working on a project for school and I am stuck on what I believe is just a small part but I cant figure it out. Here is what I have so far: #include #include #include #include #include #include…
Arob33
  • 55
  • 1
  • 6
3
votes
5 answers

How to perform shell "for" command over files with spaces in names?

I find myself frequently doing the following: for f in `find -foo -bar -baz`; do process "$f" done This of course doesn't work for file names with spaces. How can I handle such cases?
AdSR
  • 2,097
  • 3
  • 15
  • 9
3
votes
4 answers

How can I use ack (preferably ack) or grep to search for a string in a list of files?

I want to search for a string "my-search-string" in any files called search-this-one.html In all subdirectories of my current working directory. I want a list of full paths of the files that contain this string. There are hundreds of files called…
chim
  • 8,407
  • 3
  • 52
  • 60
3
votes
1 answer

How to keep parenthesis in Notepad++ regex find/replace

I'm trying to convert LIGHTING-W/AREA = ( 1.7549 ) To LIGHTING-W/AREA = ( 1.2 ) Using the notepad++ regex find/replace tool When I use LIGHTING-W/AREA = (.*) and replace with LIGHTING-W/AREA = ( 1.2 ) I get LIGHTING-W/AREA = 1.2 instead…
Anthony
  • 33
  • 1
  • 1
  • 3
3
votes
4 answers

MySQL - Find and count duplicates (Quantities)

I'm having some trouble with my shopping cart table. I've created a table that looks like this: SQL Fiddle My problem is that I want to be able to select the product id, and the count on how many times this product id is repeated in the table so I…
Erik Åstrand
  • 369
  • 2
  • 5
  • 14
3
votes
3 answers

unix: looping through results of find command

I have a find command that outputs as I would like (it looks for files with strelka in the name and ends with .vcf): find . -name *strelka* | grep '.vcf$' But I want to then iterate over each and perform additional stuff. To simply experiment,…
user3412393
  • 105
  • 1
  • 10
3
votes
3 answers

Find and replace in text files using AppleScript

I am trying to write an applescript which will run via a launch agent. What the script needs to do is edit a user preference plist file so that default save locations are specific to that user. I am aware that this can be done by just setting…
mash3d3d
  • 31
  • 1
  • 1
  • 3
3
votes
3 answers

Find element in Object Array by key value

What is the best structure solution for find element(Object) in Object Array by value of one of the keys. For example we have array: var someArray = [ {id:17, color:'black', width:50}, {id:34, color:'red', width:150}, {id:49, color:'gree',…
Stepan Suvorov
  • 25,118
  • 26
  • 108
  • 176
3
votes
1 answer

jquery add class on input click and remove class when click other input

I need to add a class to the input wrapper when I click on input, and remove the class when other input is clicked. I've tiyed toggleClass but it would only remove the class when the same input is clicked again. I've tried to use functions: find()…
mlclm
  • 725
  • 6
  • 16
  • 38
3
votes
1 answer

Find files in given subdirectories from Unix command line

Suppose I have the following directory structure: a/ a/b1 a/b1/src a/b1/target a/b2 a/b2/src a/b2/target I need to find all files by name pattern abc* only in subdirectories src, i.e. in a/b1/src and a/b2/src. How can I do it with find command ?
Michael
  • 41,026
  • 70
  • 193
  • 341
3
votes
2 answers

"invalid command code ." error from sed after running find and sed on Mavericks

I run the following command to find and replace an old web address to a new one. find . -type f -print0 | xargs -0 sed -i \ 's/http:\/\/www\.oldwebaddress\.com\/techblog/https:\/\/github\.com\/myname/g' However I get the following error. sed: 1:…
shin
  • 31,901
  • 69
  • 184
  • 271
3
votes
3 answers

find: How to force a non-zero exit status

I have glossed over the man page for find and -quit seems to partly do what I want, except it will only cause find to return non-zero if an error has occurred. So how can find be forced to return non-zero or at least be spoofed into returning…
Craig
  • 4,268
  • 4
  • 36
  • 53