Forum Replies Created

Viewing 25 posts - 1 through 25 (of 345 total)
  • Author
    Posts
  • in reply to: Simple “real lines”-export for the compare tool #28182
    Stefan
    Participant

    Fix confirmed in 904:
    “Extract Bookmarked Lines to New File” works now from both compare panels for my setup too.
    Thank you.

    in reply to: Simple “real lines”-export for the compare tool #28180
    Stefan
    Participant

    Ah, I wanted to add for the Crash :
    – tested with files with 5 lines only, as shown in my first post
    – Win 10.0.19044.1706 , 64-bit , 16GB RAM with 60% free at that moment.

    – – –

    And, FYI:
    on my test I missed a “swap files” option in the Compare menu (somehow as like in the “Compare with Options…” -dialog)
    Maybe this would be also an idea to add.

    .

    in reply to: Simple “real lines”-export for the compare tool #28179
    Stefan
    Participant

    Hello Yutaka-san,

    thank you for your advice and I want to ask to apologize my late response.

    After I have found out what you are telling me (see below), I could see that it works somehow,
    not nice for daily work, but at least there is one way. Maybe I can build a macro with that tips.

    Maybe this could also be considered as feature wish:
    >> “compare two files for differences, not line-by-line wise as the compare tool does,
    but whole files-wise, (compare each line of file A with each line of file B)”

    – Extract lines which are in first file only
    – Extract lines which are in second file only
    – Extract lines that are in both files common
    – Link to “remove duplicate lines” -command

    – – –
    Please note:
    “Extract Bookmarked Lines to New File” works for me from the left-side document only.
    If I try that from the right doc, I get a Crash (v21.7.0 , portable , with new “comparison results in one vertically split window” feature)
    – – –

    Here is what I have done as you told me to this way:

    – You could select Bookmark Changes on the Macros menu to set bookmarks on changed lines.
    (Tools > All Commands… > Compare > Bookmark Changes)
    – Then, select the Invert Bookmarks command to set bookmarks on unchanged lines.
    (Tools > All Commands… > Edit > Bookmarks > Invert Bookmarks)
    – You can then extract bookmarked lines.
    (Tools > All Commands… > Edit > Bookmarks > Extract Bookmarked Lines to New File)
    – This way might not distinguish between changes and added/delete lines, but might help.

    Thank you for making EmEditor

    Stefan
    Participant

    Hello Yutaka.
    Thank you very much for your reply and the solution. (sorry for the late response of mine)

    Even thank you more for this new feature below :D
    .
    New in Version 21.7 (May 11, 2022)
    New General Features
    The new version displays file comparison results in one vertically split window by default
    when you select the Compare or Compare with Options command.
    The previously used tiled window display is still possible by setting options.

    .

    Stefan
    Participant

    Switching between layouts doesn’t remember open Plug-ins on the left (at least for me, I am on 21.5.2).
    After switching back to a layout with before open Snippets-plugin the pane is closed and I have to re-open it.

    Maybe you can add a checkbox “[_]Remember open Plugin” to “Customize > Layouts – Options” ?

    .

    Just an hint ;-)
    /Stefan

    in reply to: Regex replace issue #28095
    Stefan
    Participant

    spiros mentions that he have to escape the backslash \ in the regex replacement by doubling it to \\

    Find: $
    Replace: [\google]
    (o) Regular Expression

    must be
    Replace: [\\google]
    (o) Regular Expression

    .

    in reply to: Replace text in multimple files ONLY in a specific XML tag #24195
    Stefan
    Participant

    You mean:

    Search for .: T11:30:00</active
    Replace with: T14:00:00</active

    Plain text search, no regex search.

     
    ?

     

    in reply to: Regex to extract digits only from a phone number #23779
    Stefan
    Participant

    FROM:
    +1(123) 456-7890 or maybe any variant of punctuation and spaces.
    +1(123)456-7890, 123-456-7890, 123.456.7890


    TO:
    1123 4567890 or maybe any variant of punctuation and spaces
    11234567890 1234567890 1234567890


    USE:
    Find: [(),.+-]
    Replace:
    [x]Use RegEx
    [Replace All]

    – – –
    Depending on your work, you can also include the space to the list of sings to become removed, like: [(),. +-]
    .
    .
    .

    Stefan
    Participant

    May I suggest to try “Quick Launch” Str+Q

    https://www.emeditor.com/text-editor-features/user-experience/quick-launch/
    .

    .

    1. open Quick Launch
    2. search for part string(s) of a command name
    3. click on found command
    4. click in menu on > Keyboard Properties

    .

    .

    HTH

    in reply to: Question of replace string via macro #23559
    Stefan
    Participant

    >>> as for example “de_DE@(.+?);” would much on too many places: <<<

    I meant >>>> “match”

     

    Sorry.

    in reply to: Question of replace string via macro #23558
    Stefan
    Participant

    So now you come with information!

    If you have the same pattern on other places too, it is normal that they are deleted there too.

    And your statement (((search “de_DE@(.+?);”, it works correctly))) is not true,
    as this removes the pattern on other place too as well with the normal Search&Replace dialog.

    – – –

    So conclusion, you can’t utilize RegEx here,
    as for example “de_DE@(.+?);” would much on too many places:

    de_DE@Produktkatalog;
    de_DE@Zubehör;
    de_DE@Ersatzteilkatalog;
    de_DE@CAD;
    de_DE@Näherungsschalter;
    de_DE@00991619;
    de_DE@Stromversorgung;

    Better search for the complete unwanted strings:
    de_DE@Stromversorgung;
    ru_RU@Источники итания;
    pl_PL@Zasilacz;
    zh_CN@电源;
    es_ES@Alimentación de corriente;
    ….

    And next time, please provide better information at first place ;-)

    Bye.
     

    in reply to: Question of replace string via macro #23554
    Stefan
    Participant

    David, best is to post how the text looks like after your test, so we can see what you see.

    in reply to: Question of replace string via macro #23550
    Stefan
    Participant

    FROM:——————-
    P_ARTICLE_DEPTH=”125″ P_ARTICLE_SPACING_FRONT=”0″ P_ARTICLE_SPACING_REAR=”0″ P_ARTICLE_DESCR1=”de_DE@Stromversorgung;en_US@Power supply unit;ru_RU@Источники питания;pl_PL@Zasilacz;zh_CN@电源;es_ES@Alimentación de corriente;fr_FR@Alimentation;it_IT@Alimentatore;nl_NL@Voeding;tr_TR@Güç kaynağı;hu_HU@Tápellátás;da_DK@Strømforsyning;cs_CZ@Zdroj napájení;pt_PT@Fonte de alimentação;sv_SE@Strömförsörjning;ko_KR@전원 공급 장치;no_NO@Strømforsyning;” P_ARTICLE_DISCONTINUED=”0″ P_ARTICLE_DISCOUNT=”0″

    TO:—————-
    P_ARTICLE_DEPTH=”125″ P_ARTICLE_SPACING_FRONT=”0″ P_ARTICLE_SPACING_REAR=”0″ P_ARTICLE_DESCR1=”en_US@Power supply unit;” P_ARTICLE_DISCONTINUED=”0″ P_ARTICLE_DISCOUNT=”0″

    TRY:——————–
    document.selection.Replace(“(de_DE|en|EN|fr_FR|ru_RU|pl_PL|zh_CN|es_ES|it_IT|nl_NL|tr_TR|hu_HU|da_DK|cs_CZ|pt_PT|sv_SE|ko_KR|no_NO)@.+?;” , “” , eeReplaceAll | eeFindReplaceRegExp,0);

    HTH? ;-)

    Stefan
    Participant

    You have to add the zero’s padding yourself.
     

    For example (a fix-two-digits result):

    
    	redraw = false;
    	if( document.selection.IsEmpty ) 
    		{
    			document.selection.StartOfDocument();
    			var iCount = prompt("Type the Start Number please:", "1");
    			var strFind = "^\\d+";
    			while(document.selection.Replace(strFind, iCount, eeFindReplaceRegExp | eeFindNext))
    				{
    					iCount++; 
    					iCount = ("0"+iCount).slice(-2); 
    				}
    		}
    

     
     
    -or, more flexible (type in ‘1’, or ’01’, or ‘001’, or ‘0001’, …. to set the wanted amount of zeros:
     

    
    	redraw = false;
    	if( document.selection.IsEmpty ) 
    		{
    			document.selection.StartOfDocument();
    			var iCount = prompt("Start Number (incl. leading zero(s):", "1");
    			var iCountLen = iCount.toString().length;
    			var strFind = "^\\d+";
    			while(document.selection.Replace(strFind, iCount, eeFindReplaceRegExp | eeFindNext))
    				{
    					iCount++; 
    					iCount = ("00000000"+iCount).slice(-iCountLen); 
    				}
    		}
    
    
    Stefan
    Participant

    “Yang Yang” wrote on June 8, 2017 at 9:21 pm
    Continuous blank lines are not treated as a block, and the caret cannot be moved to TOF/EOF as advertised. Both are easy to customize, though.

    Here is a better code

    //JumpToNextBlankLineBelow.jsee (Ctrl+Shift+Arrow-Down)
    Redraw = false;
       document.selection.Find("(\\w|\\.)$",eeFindNext | eeFindReplaceRegExp);
    if(document.selection.Find("(^\\s*?$)", eeFindNext | eeFindReplaceRegExp)==0){
       document.selection.EndOfDocument();}
       document.HighlightFind = false;
    //Redraw = true;

    //JumpToNextBlankLineAbove.jsee (Ctrl+Shift+Arrow-Up)
    Redraw = false;
       document.selection.Find("(\\w|\\.)$",eeFindPrevious | eeFindReplaceRegExp);
    if(document.selection.Find("^[[:blank:]]*?$",eeFindPrevious | eeFindReplaceRegExp)== 0){
       document.selection.StartOfDocument();}
       document.HighlightFind = false;
    //Redraw = true;

    But unfortunately the visible view doesn’t follow the cursor, if the cursor jumps out of view.

    That means:
    If the macro finds a line, the cursor is set to that line.
    But is that line position is above or below the current visible view,
    the windows is not scrolled to that line.

    But that happens only with “Redraw = false;” active.
    If I comment that command out, the scrolling works again, but the search highlighting is disturbing then.

    Tested here with 16.8.1, as 32-bit portable.

    Stefan
    Participant

    Another Idea is to have a macro directive like
    #MenuPath “Search&Replace macros”
    to add to all macro files we want to sort hierarchic in EmEditors Macros menu.
     
    So some of my macro files would contain
    #MenuPath “Search&Replace macros” as first line
     
    others
    #MenuPath “Formatting macros”
     
    other ones
    #MenuPath “Change case macros”
     
    and so on, and EmEditor would create a menu for that hierarchic structure
    and put the macros with that directive into the right sub menu.
    AllMacros\Search&Replace macros
    AllMacros\Formatting macros
    AllMacros\Change case macros

    in reply to: Arrows #21447
    Stefan
    Participant

    Yutaka, I typed in ENTER

     
    Yutaka San did not want you to TYPE the word “Enter” literal into the document,
    but rather to press the Enter key on your keyboard
    while the cursor is after the last sign on the last line..
      
      
    Hope that makes sense.

    in reply to: Arrows #21432
    Stefan
    Participant

    The arrows you mention are probably the End-Of-Line (EOL) symbols for CRLF and LF respectively.
    Picture: https://www.emeditor.com/text-editor-features/coding/multiple-selection-editing/
     
    You can enable the visibility via “View > Marks > Returns” … and “CR and LF with different Marks”.
     
    There should be only one type of that EOL-markers in one file: DOS/Windows (CRLF) -or- Unix (LF).
    To change that EOL setting, utilizing “File > Save as…” and chose the wanted line endings from the drop-down menu in that dialog.
     
     
    Stefan

    Stefan
    Participant

    Thanks LTT, both of your solutions works! Well done. ( Double JS-and-RegEx escaping tricked me again ;-) )

    Stefan
    Participant

    Sorry, but with “document.selection.Replace” I get a mess like you have experienced, even replace ‘a’ by ‘X’ didn’t work for the whole example text.
     

    nLines = document.GetLines();
    var count=1;
    for(L=1;L<nLines;L++){
    	document.selection.SelectLine();
    	//document.selection.Replace("\[1!#\d+\]","[1!#"+count+"]", eeReplaceSelOnly | eeReplaceAll | eeFindReplaceRegExp);
    	document.selection.Replace("a","X", eeReplaceSelOnly | eeReplaceAll );
     	count++;
     	document.selection.LineDown();
    }

     
     
    Highly probable there is a trick I don’t get. Oh, and I use 15.7.0./ 32-bit portable here.
     
     
     

    Stefan
    Participant

    the string after equal sign(=). I have to modify them one by one to make them be consecutive.

    FROM:
    partnr=[1!#10]
    productgroup=[1!#2]
    productsubgroup=[1!#3]
    description1=”zh_CN@”+[1!#15]+”;”+”en_US@”+[1!#16]+”;”
    note=”zh_CN@”+[1!#17]+”;”+”en_US@”+[1!#18]+”;”
    assemblyposition count=[1!#4]
    parentvariant=[1!#5]
    partnr=[1!#6]
    pos=[1!#7]
      
      
    TO:
    partnr=[1!#1]
    productgroup=[1!#2]
    productsubgroup=[1!#3]
    partnr=[1!#4]
    productgroup=[1!#5]
    productsubgroup=[1!#6]
    description1=”zh_CN@”+[1!#15]+”;”+”en_US@”+[1!#16]+”;”
    note=”zh_CN@”+[1!#17]+”;”+”en_US@”+[1!#18]+”;”
    assemblyposition count=[1!#7]
    parentvariant=[1!#8]
    partnr=[1!#9]
    pos=[1!#10]
      
      
    Use for example:

    if( document.selection.IsEmpty ) {document.selection.SelectAll();}
    sSel = document.selection.text; //alert(sSel);
    
    aLines = sSel.split("\r\n");
    
    aOut="";
    iCount=1;
    
    for (var i=0,x=aLines.length;i<x;i++) {
    	if (aLines[i].match(/=\[1!#\d+\]/)){
    		aOut += aLines[i].replace(/=\[1!#\d+\]/,'=[1!#'+iCount+']') + "\r\n";
    		iCount++;
    	}
    	else {
    		aOut += aLines[i] + "\r\n";
    	}
    };
    
    alert(aOut);
    //document.selection.text = aOut;

     
      
      
      
    HTH? ;-)

    Stefan
    Participant

    EmEditor v16.2.0 beta 2 ; September 30, 2016
    New General Features
    The Find Extract … number of lines above and below the matched lines, and specify the separator.
    The Extract All button was added to the Replace dialog box.

    Beta 2 shows a separator line between separated blocks after filtered,

    EmEditor v16.2.0 released! ; October 5, 2016
    New General Features
    The Filter toolbar allows you to specify additional lines to display before and after matched lines.

     

     

    Thank you, great additions and works great, good work Yutaka.

     
    Hint:
    I know I can use “Find” and “Extract” for that feature too, and that is totally fine,
    but I think the “Filter toolbar” misses that separator feature(*) for the “Extract All” button?
    (*) like the Extract button in the Find dialog.

    Thank you for making EmEditor.

     

    in reply to: Adding info about replaced number #21144
    Stefan
    Participant

    show number of changed phrases

    EmEditor shows that info at the status bar (menu ‘ View > Status Bar ‘ )
     
    BTW, to customize what is shown at the status bar, see menu ‘ Tools > Customize… > [Status]’

     

    in reply to: Filter lines – option to show lines before and after finded #21090
    Stefan
    Participant

    EmEditor v16.2.0 beta 1, September 26, 2016

    New General Features

    The Filter toolbar allows you to specify additional lines to display before and after matched lines.
    The Number of Additional Visual Lines Above Matched Lines and Number of Additional Visual Lines Below Matched Lines drop-down list boxes were added to the Filter toolbar.

    Link to announcement page >> https://www.emeditor.com/emeditor-beta/emeditor-v16-2-0-beta-1/
     
    Works fine here. Even is filtered line was at TOF or EOF
    and so there were no additional lines to show as I had set in ‘Additional Visual Lines’

     
    Idea: maybe you can add an option to insert a line delimiter between extracted line-blocks?

    Like:

    Filter ‘error’ ; Additional lines before:1 ; Additional lines after: 2 ; Block Delimiter:[ ~~~ ]
    Line error
    Line
    Line
    ~~~
    Line
    Line error
    Line
    Line
    ~~~
    Line
    Line error
    .
    .
     

    in reply to: Possible to set a "Marker" (Highlight Word) from within a macro? #21046
    Stefan
    Participant

    Thank you very much for the feedback.
     
    That way works, but I miss a way to adjust the added marker, to highlight all spellings and ‘whole word only’.
    Maybe I am better use the ‘Find’ command only, to highlight the ‘MySearchStr’ string.
     

     
    MY USAGE EXAMPLE:
    -search code here to find lines containing ‘MySearchStr’-
    -then I extract that lines incl. surrounding lines to another document:
    editor.NewFile()
    document.writeln(resultText)
    document.selection.Find MySearchStr, eeFindPrevious
    document.selection.SelectWord
    editor.ExecuteCommandByID 4560

     
    .

Viewing 25 posts - 1 through 25 (of 345 total)