Search file names that contain a string - phpstorm

I have a module named flume and file names that include that module name, like flumeIndexController, flumePlugin etc. Now I've decided to rename the module to oozie so I want to have these files renamed to include new module's name like oozieIndexController, ooziePlugin.
How can I get a list of files than include the flume string (in file name) possibly using built-in search or through any other option?

Navigate | File... Ctrl + Shift + N using Default keymap.
You can narrow your search results (just specify parts of the path, e.g. /abc/ and it will show results in a folders that match such pattern/abbreviation). Alternatively -- just do a post-filtering by excluding unwanted results (see below).
This window has only 2 buttons -- one of which will display results in a more traditional and permanent "Search results" tool window (the one that you see when you do Find in Path and alike).

Related

How to Search Access DB and Make A DB Wide Search & Replace Operation

we have an access database. We had been using http://www.example.com on various data sections. Now we want to search this URL and replace all occurrences.
I am not sure if Find and Replace utility works in this case. Because Look in field is set to Current Document but my search does not bring expected results.
The goal is only changing domain name so any URL that starts with http://www.example.com will be updated and URLs will start with http://www.newexample.com
One thing that comes to my mind is exporting 40 tables as CSV and doing the operation via Notepad++ and import the resulting CSV file back to database.
In the Find and Replace dialog, make sure that Match is set to Any Part of Field.

NiFi : Regular Expression in ExtractText gets CSV header instead of data

I'm working on a flow where I get CSV files. I want to put the records into different directories based on the first field in the CSV record.
For ex, the CSV file would look like this
country,firstname,lastname,ssn,mob_num
US,xxxx,xxxxx,xxxxx,xxxx
UK,xxxx,xxxxx,xxxxx,xxxx
US,xxxx,xxxxx,xxxxx,xxxx
JP,xxxx,xxxxx,xxxxx,xxxx
JP,xxxx,xxxxx,xxxxx,xxxx
I want to get the field value of the first field i.e, country. Put those records into a particular directory. US records goes to US directory, UK records goes to UK directory, and so on.
The flow that I have right now is:
GetFile ----> SplitText(line split count = 1 & header line count = 1) ----> ExtractText (line = (.+)) ----> PutFile(Directory = \tmp\data\${line:getDelimitedField(1)}). I need the header file to be replicated across all the split files for a different purpose. So I need them.
The thing is, the incoming CSV file gets split into multiple flow files with the header successfully. However, the regex that I have given in ExtractText processor evaluates it against the splitted flow files' CSV header instead of the record. So instead of getting US or UK in the "line" attribute, I always get "country". So all the files go to \tmp\data\country. Help me how to resolve this.
I believe getDelimitedField will only work off a singular line and is likely not moving past the newline in your split file.
I would advocate for a slightly different approach in which you could alter your ExtractText to find the country code through a regular expression and avoid the need to include the contents of the file as an attribute.
Using a regex of ^.*\n+(\w+) will capture the first line and the first set of word characters up to the comma and place them in the attribute name you specify in capture group 1. (e.g. country.1).
I have created a template that should get the value you are looking for available at https://github.com/apiri/nifi-review-collateral/blob/master/stackoverflow/42022249/Extract_Country_From_Splits.xml

Search within files in search result in Sublime

I often use Sublime Text 2's search all open files/folders feature (CMD+SHIFT+F).
Is it possible to perform a second search that only queries files which contain the first search query?
For example: Search 1 finds 5 files that contain "hello". Search 2 should only query those same 5 files for "world", so the resulting matches will be files which contain both "hello" and "world".
I can search the text which is visible in the results buffer (such as in the screenshot below), but I'd like to search the entire contents of all files that are shown in the results buffer.
1:
Open the find_in_files panel with Ctrl + Shift + F.
In the example, <open folders> is used for the Where: argument, but you can use whatever fits your initial search criteria.
2:
Open the find panel with Ctrl + F while you are still in the results buffer.
Enter ^(/Users/.*)(?=:$) as your Find: argument, and make sure the RegEx switch is enabled. This RegEx pattern will match all of the paths within the results.
( Windows users can enter ^(C:\\.*)(?=:$) )
Copy the selected paths.
3:
Paste the copied paths into a blank document.
Open the replace panel with Ctrl + H.
Enter ^(/Users/.*)(\n) as the Find What: argument, and $1$2,  as the Replace With: argument. This will effectively convert all of the lines into a single line of comma separated values.
( Windows users can enter ^(C:\\.*)(\n) )
Copy the resulting line.
4:
Open the find_in_files panel with Ctrl + Shift + F.
Paste the copied path list as your Where: argument, and enter your second query as the Find: argument.
5:
Repeat as necessary.

How to search multiple files of specific file type within Sublime Text 3

I would like to search for a string within all *.php files in a certain directory (and its sub-directories) using the Shift + Ctrl + F search dialog.
My guess was to set the search location to:
c:\example\*.php
but that gives an error:
Unable to open c:\example\*.php
Is there a way to perform the search I'm hoping to perform?
C:\example,*.php
In the Where: click ..., select Add Folder, after that select Add Include Filter

how to load extracted file name into sql server table in SSIS

i have 3 csv files in a folder which contains eid, ename, country fields, and my 5 csv files names are test1_20120116_034512, test1_20120116_035512,test1_20120116_035812 etc.. my requirement is I want to take lastest file based on timne stamp and modified date, which i have done. Now i want to import the extracted file name into destination table..
my destination tables contains fields like,
filepath, filename, eid, ename, country
I have posted regarding this before in the same site i got an answer for extracting filename, now i want to load the extracted FileName into destination table
Import most recent csv file to sql server in ssis
my destination tables should have output as
C:/source test1_20120116_035812 1234 tester USA
In your DataFlow task, add a Derived Column Transformation. The value of CurrentFile will be the fully qualified path to the file. As you only want the file name, I would look to use a replace function on that with the base folder and then strip the remaining slash. This does not strip the file extension but you can add yet another call to REPLACE and substitute an empty string
Derived Column Name: filename
Derived Column:
Expression: REPLACE(REPLACE(#[User::CurrentFile], #[User::RootFolder], ""), "\\", "")
The above expects it to look like
CurrentFile = "C:\source\test1_20120116_035812.csv"
RootFolder = "C:\source"
Edit
I believe you've done something in your approach that I did not do. You should see a warning about possible truncation but given the values discussed in this and the preceding question, I don't believe the 4k limit on expressions will be of concern.
Displaying the derived column
Demonstrating the derived column does work
I will give you a +1 for providing an approach I wasn't aware of, but you'll still need to add a derived column to match your provided format (base path name)
Full path is provided from the custom properties. Use the above REPLACE section to remove the path info except use the column [FileName] instead of #[User::CurrentFile]
I tried to get the filename through the procedure which Billinkc has given, but its throwing me error stating that filename column failed becaue of truncation error..
Any how i tried different approach to load file name into table.
steps i have used
1. right click on flat file Source and click on show advanced edito for Flat file
2. select component Properties tab
3. Inside that Custom Properties section ---> it has a property FileNameColumnName
I have assigned Filename to that column property like
FileNameColumnName----> FileName thats it, am able to get the filename into my destination table..