find

Linux: fast creating of formatted output file (csv) from find command

不羁岁月 提交于 2021-01-29 21:39:19
问题 I have several devices, which I want to collect in a list (csv) to put them into a mysql database. I began with a device with the goal to create a new formatted output file, from infile file which was created with 'find'. The device is /mnt/sda4 and I have skipped all entries containing '.cache'. I also have already cut /mnt/sda4/ : find /mnt/sda4 | grep -v '.cache' | cut -d'/' -f4- > infile where the infile is like that: Extern-500GB-btrfs/root/usr/lib64/libreoffice/share/config/soffice.cfg

Search for a file in C++

岁酱吖の 提交于 2021-01-29 20:10:52
问题 I'm new in C++ and i need to search the drives for a specific file and display them or list them in a listbox. Here's what i have so far. Some bits and pieces i found in the forums and stuff i have added. My question is how do i put them together. Lets say i'm searching for a file called "test.txt" Thanks! // search for drives char* szSingleDrive; DWORD dwSize = MAX_PATH; char szLogicalDrives[MAX_PATH] = { 0 }; DWORD dwResult = GetLogicalDriveStrings(dwSize, szLogicalDrives); UINT

Search for a file in C++

二次信任 提交于 2021-01-29 16:12:51
问题 I'm new in C++ and i need to search the drives for a specific file and display them or list them in a listbox. Here's what i have so far. Some bits and pieces i found in the forums and stuff i have added. My question is how do i put them together. Lets say i'm searching for a file called "test.txt" Thanks! // search for drives char* szSingleDrive; DWORD dwSize = MAX_PATH; char szLogicalDrives[MAX_PATH] = { 0 }; DWORD dwResult = GetLogicalDriveStrings(dwSize, szLogicalDrives); UINT

Find files recursively and rename based on their full path

隐身守侯 提交于 2021-01-29 09:52:17
问题 I'm looking to search for files of a specific name, modify the name to the full path and then copy the results to another folder. Is it possible to update each find result with the full path as the file name; i.e. ./folder/subfolder/my-file.csv becomes folder_subfolder_my-file.csv I am listing the files using the following and would like to script it. find . -name my-file.csv -exec ls {} \; 回答1: Since you're using bash, you can take advantage of globstar and use a for loop: shopt -s globstar

PowerShell - Find and replace multiple patterns to anonymize file

↘锁芯ラ 提交于 2021-01-29 04:45:56
问题 I need you help. I have a log.txt file with various data in it which I have to anonymize. I would like to retrieve all these "strings" matching a predefined patterns, and replace these by another values for each of them. What is important is that each new string from the same pattern (and with different value from the previous) should be replaced by the predefined value increased by +1 (e.g. "orderID = 123ABC" becomes "orderID = order1" and "orderID=456ABC" becomes "orderID=order2"). The

PowerShell - Find and replace multiple patterns to anonymize file

北城余情 提交于 2021-01-29 04:36:10
问题 I need you help. I have a log.txt file with various data in it which I have to anonymize. I would like to retrieve all these "strings" matching a predefined patterns, and replace these by another values for each of them. What is important is that each new string from the same pattern (and with different value from the previous) should be replaced by the predefined value increased by +1 (e.g. "orderID = 123ABC" becomes "orderID = order1" and "orderID=456ABC" becomes "orderID=order2"). The

C++ Fastest way to find first space in right-padded null-terminated char array of fixed size 9

試著忘記壹切 提交于 2021-01-29 04:26:36
问题 The average length is 4 characters for the strings. I was thinking a binary search might be the fastest starting at position 4. Also I think an inlined templatized function might perform well. This is done in a very tight loop so performance is critical. The data looks like: "1234 " "ABC " "A1235 " "A1235kgo" 回答1: char* found = std::find(arr, arr+9, ' '); Note that 'no match' is signaled wuth the end iterator: bool match = (arr+9) != found; Note, that binary search doesn't apply unless you

open closest ul on click jQuery

梦想与她 提交于 2021-01-29 02:45:27
问题 when clicking a.market-metro, open closest ul.children. <ul class="drop-padding"> <li> <a class="market-metro">text</a> <ul class="children">...</ul> </li> <li> <a class="market-metro">text</a> <ul class="children">...</ul> </li> <li> <a class="market-metro">text</a> <ul class="children">...</ul> </li> I have the following but not working: jQuery(".market-metro").click(function(){ if (jQuery(".market-metro").closest('li').find('ul.children').hasClass("expanded")) { jQuery(".market-metro")

Shell - copying directories recursively with RegEx matching preserving tree structure

断了今生、忘了曾经 提交于 2021-01-28 09:14:46
问题 I need to write a script, that would copy a directory recursively, but only copying subdirectories and files matched by a certain RegEx. For instance for a tree like this: . └── toCopy ├── A │ ├── 123 │ ├── D │ │ └── rybka23 │ ├── file │ ├── file1 │ └── random ├── B ├── C │ ├── file_25 │ └── somefile └── E1 └── something For a RegEx .*[0-9]+ I need to get a new directory: newDir ├── A │ ├── 123 │ ├── D │ │ └── rybka23 │ └── file1 ├── C │ └── file_25 └── E1 So my first thinking was something

Shell - copying directories recursively with RegEx matching preserving tree structure

人走茶凉 提交于 2021-01-28 09:10:39
问题 I need to write a script, that would copy a directory recursively, but only copying subdirectories and files matched by a certain RegEx. For instance for a tree like this: . └── toCopy ├── A │ ├── 123 │ ├── D │ │ └── rybka23 │ ├── file │ ├── file1 │ └── random ├── B ├── C │ ├── file_25 │ └── somefile └── E1 └── something For a RegEx .*[0-9]+ I need to get a new directory: newDir ├── A │ ├── 123 │ ├── D │ │ └── rybka23 │ └── file1 ├── C │ └── file_25 └── E1 So my first thinking was something