Ue-alex-js-20141125__js

Source: Internet
Author: User
Tags switches ultraedit
function Trim (str)
{
Remove the Str from the end of the space
var Temp1 = str.replace (/(^\s*) | ( \s*$)/g, "");
Remove the single quotation mark from the end of STR
var temp2 = temp1.replace (/^ ' *) | (' *$)/g, "");
Remove the double quotes from the STR
var Temp3 = temp2.replace (/(^ "*" *) | (" *$)/g, "");
return Temp3;
}


UltraEdit.activeDocument.bottom (); Jumps to the end of the file.
var num = UltraEdit.activeDocument.currentLineNum; Get Current line number


UltraEdit.activeDocument.findReplace.regExp = true; Use regular expressions to find
Ultraedit.uereon (); Switches the regular expression to a regular expression that conforms to the UE style.
Ultraedit.unixreon (); Switches the regular expression to a regular expression that matches the Unix-style pattern.
Ultraedit.perlreon (); Switches the regular expression to a Perl-style regular expression.
var regexpfind = "";
/*
UltraEdit.activeDocument.top ();
var x = num;


while (x>0)
{
UltraEdit.activeDocument.findReplace.find (Regexpfind); Find String str
UltraEdit.activeDocument.selectLine ();
line = UltraEdit.activeDocument.selection;
Ultraedit.messagebox (line);
var line2 = Trim (line)
Ultraedit.document[0].write (' Db.store.find ({' name ': ' ' +line2+ '}). Count () ' + ' \ n ');
UltraEdit.activeDocument.findReplace.find (Regexpfind);
x--;
}
*/
UltraEdit.activeDocument.top ();
while (UltraEdit.activeDocument.findReplace.find (Regexpfind))
{
UltraEdit.activeDocument.selectLine ();
line = UltraEdit.activeDocument.selection;
Ultraedit.messagebox (line);
var line2 = Trim (line);
Ultraedit.document[0].write (' Db.store.find ({' name ': ' ' +line2+ '}). Count () ' + ' \ n ');
UltraEdit.activeDocument.findReplace.find (Regexpfind);
}


Ultraedit.document[0].write ("\n===========\n")
UltraEdit.activeDocument.top ();
while (UltraEdit.activeDocument.findReplace.find (Regexpfind))
{
UltraEdit.activeDocument.selectLine ();
line = UltraEdit.activeDocument.selection;
Ultraedit.messagebox (line);
var line2 = Trim (line);
Ultraedit.document[0].write (' Db.store.find ({' name ': ' ' +line2+ ' '},{' name ': 1, ' Subsidiaryflag ': 1}). Pretty () ' + ' \ n ') ;
UltraEdit.activeDocument.findReplace.find (Regexpfind);
}


Ultraedit.document[0].write ("\n===========\n")
UltraEdit.activeDocument.top ();
while (UltraEdit.activeDocument.findReplace.find (Regexpfind))
{
UltraEdit.activeDocument.selectLine ();
line = UltraEdit.activeDocument.selection;
Ultraedit.messagebox (line);
var line2 = Trim (line);
Ultraedit.document[0].write (' db.store.update ({' name ': ' ' +line2+ '},{$set: {"Subsidiaryflag": "False"}}); ' + "\ n");
UltraEdit.activeDocument.findReplace.find (Regexpfind);
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.