find

Find and rename all pictures with incorrect file extension

走远了吗. 提交于 2019-12-24 03:23:30
问题 I'm looking for a way to automate renaming all images with a wrong filename extension. So far I at least found out how to get the list of all these files: find /media/folder/ -name *.jpg -exec file {} \; | grep 'PNG\|GIF' > foobar.txt find /media/folder/ -name *.png -exec file {} \; | grep 'JPEG\|GIF' >> foobar.txt find /media/folder/ -name *.gif -exec file {} \; | grep 'JPEG\|PNG' >> foobar.txt However, I would also like to automate the renaming. I tried things like find /media/folder/ -name

Optimizing a one-line find + exec command

巧了我就是萌 提交于 2019-12-24 02:45:14
问题 I need to get the file information (name, size, date modified) of about 1M+ files on a system. The command I am currently using is: sudo find "$FULFILLMENT" "$ARCH1" "$ARCH2" "$MASTERING" -type f -exec ls -lT {} + Is there a way to improve this? The only requirement is I must get all the files in the above volumes and for each file, pull the name, size, and date_modified. (Is there a way to do a stat command here instead? Would that speed things up?) This takes about an hour on a fiber

`find -name` with regex pattern and filename replacement using `cp`

妖精的绣舞 提交于 2019-12-24 02:04:27
问题 Currently I'm using the command in cron to make copy of *.data from source to target path: find /source_path -name *.data -exec cp {} /target_path \; The source structure is: /source_path/category1/001.data /source_path/category1/002.data /source_path/category2/003.data /source_path/category3/004.data /source_path/categorya/005.data /source_path/categoryb/006.data After the above cron command, the target will contain: /target_path/001.data /target_path/002.data /target_path/003.data /target

Find border (boundary) edges of planar graph (geometric shape)

一个人想着一个人 提交于 2019-12-24 02:03:24
问题 I have vertices and an edge list that describe a planar geometric shape (faces are triangles). For example: a_______b /|\ / / | \ / e/__|__\/c d Verts: a, b, c, d, e Edges: (a,b), (a,c), (a,d), (a,e), (b,c), (c,d), (d,e) So that is all the information I would have about that particular planar geometric shape. In this example, the only internal edges are (a,c) and (a,d). All other edges are border edges. How can I identify those border edges algorithmically (or conversely identify all internal

Formula to match/lookup if part of a string in a cell is equal to a value in a given range and return this value

我是研究僧i 提交于 2019-12-24 01:54:36
问题 I have two text ranges in two columns in excel like that: ____________________________________________________________ | A | B | C | ------------------------------------------------------------ 1 | Mazda Mazda6 i | Escape | | 2 | Ford F150 XL | Pathfinder | | 3 | Ford Freestar SEL | Jetta | | 4 | Ford Explorer Eddie Bauer | Yaris | | 5 | Ford Escape XLT | Mazda6 | | 6 | Nissan Pathfinder LE | F150 | | 7 | Volkswagen Jetta 2.5 | Tahoe | | 8 | Toyota Yaris Base | Freestar | | 9 | Chevrolet

How can I get files older than a specified date?

夙愿已清 提交于 2019-12-24 01:53:48
问题 I apologize if this question was already asked but I can't seem to find exactly what I am looking for. I want to be able to find files in XP (using cmd) that are older than a specific date. I want to do something like DIR/FIND files that are older than 30 days. The following does not work but hopefully it will give you an idea of what I am trying to do. FOR /f %%f IN ('DIR /b /t -30 I:\FOLDER1\*.pdf') DO move /Y Z:\FOLDER1\%%f "I:\FOLDER2\" Thanks! 回答1: Julian date function are taken from

Find and copy code

本小妞迷上赌 提交于 2019-12-24 01:43:15
问题 Right people, I’m back again for some more help. I have a workbook where I add new worksheets every month with information which is exactly the same as before in structure. In column A, I have invoice numbers then details from columns B:J. In columns K & L there are comments manually added for all outstanding issues. What I want to do is be able to lookup invoices against the last worksheet and then copy comments in columns K & L into the new worksheet. I have tried to create a bit of code

Find (bash command) doesn't work with subprocess?

巧了我就是萌 提交于 2019-12-24 01:24:19
问题 I have renamed a css class name in a number of (python-django) templates. The css files however are wide-spread across multiple files in multiple directories. I have a python snippet to start renaming from the root dir and then recursively rename all the css files. from os import walk, curdir import subprocess COMMAND = "find %s -iname *.css | xargs sed -i s/[Ff][Oo][Oo]/bar/g" test_command = 'echo "This is just a test. DIR: %s"' def renamer(command): print command # Please ignore the print

recordset.find using variable VBA ADODB

六眼飞鱼酱① 提交于 2019-12-24 01:12:28
问题 I am getting pretty desperate trying to get this trivial search to work: rst2.Find "ID = '" & messID & "'" I have tried just about any combination but it just never returns a search result. the whole code would be here: Option Compare Database Option Explicit 'Modul zum Updaten des Status eines Messmittels in der Stammdatenbank (Entnommen/Verfügbar)3 Public Function updateStatus() Dim rst2 As ADODB.Recordset Dim rst As ADODB.Recordset Dim messID As String Set rst = New ADODB.Recordset

Parameter expansion for find command

筅森魡賤 提交于 2019-12-24 00:24:37
问题 Consider the code (the variable $i is there because it was in a loop, adding several conditions to the pattern, e.g. *.a and *.b , ... but to illustrate this problem only one wildcard pattern is enough): #!/bin/bash i="a" PATTERN="-name bar -or -name *.$i" find . \( $PATTERN \) If ran on a folder containing files bar and foo.a , it works, outputting: ./foo.a ./bar But if you now add a new file to the folder, namely zoo.a , then it no longer works: find: paths must precede expression: zoo.a