Emeditor Multiple Marking

252 views Asked by At

I have this text file containing employees and their details, I want to mark only those employees whose job_title is Operations Manager and their business_email. Please tell me how can I do this in Emeditor or Notepad++ or any other way?

Sample

["state": true,
    "employees": [
        {
            "first_name": "Kate",
            "last_name": "Garland",
            "headline": "Director of Communications and Enrollment",
            "job_title": "Director of Communications and Enrollment",
            "location": "Clearwater, Florida, United States",
            "business_email": "[email protected]",
            "personal_email": "[email protected]",, fi}{ln}"
        },
        {
            "first_name": "Dorina",
            "last_name": "Valentin",
            "headline": "Operations Manager",
            "job_title": "Operations Manager",
            "location": "New York, New York, United States",
            "business_email": "[email protected]",
            "personal_email": "",, fi}{ln}"
        },
        {
            "first_name": "Shannon",
            "last_name": "Sheppard",
            "headline": "Founding Member",
            "job_title": "Founding Member",
            "location": "Tampa, Florida, United States",
            "business_email": "[email protected]",
            "personal_email": "[email protected]",, fn}{ln}"
        },
        {
            "first_name": "Nicole",
            "last_name": "Peacock",
            "headline": "Realtor",
            "job_title": "Realtor",
            "location": "Dayton Metropolitan Area",
            "business_email": "[email protected]",
            "personal_email": "[email protected]",, fi}{ln}"
        },
3

There are 3 answers

0
Venturer On BEST ANSWER

Set the following options under EmEditor - Find - Advanced button, and set the following options:

Search for: ^\s*{.+?"Operations Manager".+?},

and Click the "Select All" button.

enter image description here

Then Find ".", click "In the selection only" and Click the Bookmark button:

enter image description here

This will bookmark the relevant records. If you just want to bookmark the email (It wasn't entirely clear in your question), then change "." to "business_email" and click bookmark.

2
MakotoE On

Assuming the JSON file is formatted correctly, you can Find (Ctrl-F) for the string "job_title": "Operations Manager". In the Find dialog there is the button "Bookmark" if you want to mark those lines.

0
TM1 On

@Claudia, your request is already done for you? If not, let me know if one of my example fit your request.

I could not tell from your request,

  • whether this is a recurring task. In this case I would always create a macro in EmEditor.
  • 100mb size are a lot data sets, filtering the data would be more convenient from my point of view than just mark it only.

How familiar are you with EmEditor? Whit EmEditor it is also very easy to extract or filter them (I don't know that Notepad++ has this function filter, extract, etc.. Since Notepad++ can not open my large files, I have no experience with Notepad++). Here you can extract the searched data sets (the original file remains unchanged) and you have a new file with the hits. Whether these are found with the filter or search/search replace does not really matter. Please always use the latest version (also beta version) of EmEditor.

first example (Find - Extract):

  • if you use in point 4 "3", you get the hole data sets, with 0 you get only lines above

find-extract

find-extract-result

second example (macro): In this marcro are only single command where can be done also manualy. my Steps:

  • stop refresh window

  • search data sets with regular expressions and extract it to new doc with tabulator delimiter

  • put the headline on top

  • activate CSV view (with tab)

  • activate heading line

  • filter Operations Manager (it whould be also posible to extract hits directly)

     Redraw = false
     document.selection.Replace("{\\n\\s{1,}\"first_name\":(.+),\\n\\s{1,}\"\\w+\":\\s{1,}(.+),\\n\\s{1,}\"\\w+\":\\s{1,}(.+),\\n\\s{1,}\"\\w+\":\\s{1,}(.+),\\n\\s{1,}\"\\w+\":\\s{1,}(.+),\\n\\s{1,}\"\\w+\":\\s{1,}(.+),\\n\\s{1,}\"\\w+\":\\s{1,}(.+),,","\\1\\t\\2\\t\\3\\t\\4\\t\\5\\t\\6\\t\\7",eeReplaceAll | eeFindReplaceRegExp | eeFindExtract | eeFindLineOnly,0);
     document.selection.StartOfDocument(false);
     document.selection.LineOpen(true);
     document.selection.Text= "first_name\tlast_name\theadline\tjob_title\tlocation\tbusiness_email\tpersonal_email"
     editor.ExecuteCommandByID(22529);  // 
     document.HeadingLines = 1
     document.Filter("Operations Manager",4,0,0,0,0,0,0);
    

result_macro_whitout_filter

result_macro_with_filter

You can only really compare the speeds of the different solution options with the original data.