As per the subject I want to make the following replacement of strings when parsing. Could you pls help out what command to issue?
[S -> S
[D -> D
[L -> L
It is the beginning of the log file emitted by War-FTPD.
What functions can I use to do the conversion in one query?
The query command will look like this, I think:
Select <the query command in question> From <the log file> TO CSV1a.txt" -q: ON -i:TEXTLINE -iCodepage:ascii -recurse:off
The actual log file pattern is like:
[D 2004 01 01 11:57] Connected to Local IP: <The IP of the server>
[D 2004 01 01 11:57] 00082 prelogin cntr SendCtrlMsg(): Unable to open message file
[D 2004 01 01 11:57] 00082 prelogin cntr Clear To Send.
[D 2004 01 01 11:57] 00082 prelogin cntr Command: USER anonymous
[D 2004 01 01 11:57] 00082 prelogin cntr SendCtrlMsg(): Unable to open message file
[L 2004 01 01 11:57] 00082 prelogin cntr User from <the IP of the client> logged out
If all you're trying to do is to really remove just the first '[' from every line, you can also do:
SELECT SUBSTR(Text, 1)
Which will remove the first character from each line.
------------------------------
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm"
Hi. As for the replacestr I succeeded in lipping off the needless '[' at the first place and ']' at the 20th place. I am also curious of what query string I should make when I want to remove '[' and ']' with substr function. Pls let me know of this, too. ;-)
------------------------------
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
Anonymous
6623 Posts
Replace multiple patterns of strings in one query?
Feb 18, 2004 07:40 AM|LINK
Hi.
As per the subject I want to make the following replacement of strings when parsing. Could you pls help out what command to issue?
[S -> S
[D -> D
[L -> L
It is the beginning of the log file emitted by War-FTPD.
What functions can I use to do the conversion in one query?
The query command will look like this, I think:
Select <the query command in question> From <the log file> TO CSV1a.txt" -q: ON -i:TEXTLINE -iCodepage:ascii -recurse:off
The actual log file pattern is like:
[D 2004 01 01 11:57] Connected to Local IP: <The IP of the server>
[D 2004 01 01 11:57] 00082 prelogin cntr SendCtrlMsg(): Unable to open message file
[D 2004 01 01 11:57] 00082 prelogin cntr Clear To Send.
[D 2004 01 01 11:57] 00082 prelogin cntr Command: USER anonymous
[D 2004 01 01 11:57] 00082 prelogin cntr SendCtrlMsg(): Unable to open message file
[L 2004 01 01 11:57] 00082 prelogin cntr User from <the IP of the client> logged out
Anonymous
6623 Posts
Re: Replace multiple patterns of strings in one query?
Feb 18, 2004 06:15 PM|LINK
You can use:
SELECT REPLACE_STR(REPLACE_STR(REPLACE_STR( Text, '[L', 'L'), '[S', 'S'), '[D', 'D')
which looks pretty ugly....but it works :-)
If all you're trying to do is to really remove just the first '[' from every line, you can also do:
SELECT SUBSTR(Text, 1)
Which will remove the first character from each line.
------------------------------
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm"
Anonymous
6623 Posts
Re: Replace multiple patterns of strings in one query?
Feb 19, 2004 08:36 AM|LINK
Anonymous
6623 Posts
Re: Replace multiple patterns of strings in one query?
Feb 20, 2004 11:52 AM|LINK
SUBSTR( SUBSTR(Text, 1), 0, SUB(INDEX_OF(Text, ']'), 1))
------------------------------
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm