yaqwa Posted June 14, 2005 Report Share Posted June 14, 2005 how can i do this I have a text file from a server log and just want to delete all lines where my own ip was included (for better view) by example 64.12.116.67 - - [14/Jun/2005:10:45:51 +0200] "GET /g... HTTP/1.0" 127.0.0.1 - - [14/Jun/2005:12:34:55 +0200] "GET /p..... 64.12.116.67 - - [14/Jun/2005:10:45:51 +0200] "GET /g... HTTP/1.0" 127.0.0.1 - - [14/Jun/2005:12:34:55 +0200] "GET /p..... 64.12.116.67 - - [14/Jun/2005:10:45:51 +0200] "GET /g... HTTP/1.0" 127.0.0.1 - - [14/Jun/2005:12:34:55 +0200] "GET /p..... 64.12.116.67 - - [14/Jun/2005:10:45:51 +0200] "GET /g... HTTP/1.0" 64.12.116.67 - - [14/Jun/2005:10:45:51 +0200] "GET /g... HTTP/1.0" 64.12.116.67 - - [14/Jun/2005:10:45:51 +0200] "GET /g... HTTP/1.0" 64.12.116.67 - - [14/Jun/2005:10:45:51 +0200] "GET /g... HTTP/1.0" 127.0.0.1 - - [14/Jun/2005:12:34:55 +0200] "GET /p..... I want to do this with a macro 1.copy the log file to a new file (server.log --------> view.txt) 2.than delete all lines where 127.0.0.1 is at the beginning of each line 3.open that file for me to see thats all I know how to copy and open but i do not know how to delete those lines please help Quote Link to comment Share on other sites More sharing options...
kevin Posted June 14, 2005 Report Share Posted June 14, 2005 Use the Text File Begin/End Process commands. Text File Begin Process: "test.txt" If Variable %T1% does not contain "127.0.0.1" Variable Modify String: Append %T1% to Text File End If Text File End Process <BTFBEG:001:000001:000000:c:\test.txt><IFVAR2:1:01:8:127.0.0.1><TMVAR2:20:01:00:000:000:c:\output.txtT><ENDIF><BTFEND> Quote Link to comment Share on other sites More sharing options...
kevin Posted June 14, 2005 Report Share Posted June 14, 2005 To explain a little further: Macro Express cannot delete a line in a file. But, you can write lines from the existing file to a new file and skip the ones you do not want. Quote Link to comment Share on other sites More sharing options...
yaqwa Posted June 14, 2005 Author Report Share Posted June 14, 2005 runnig thank you very much Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.