Jan 31, 2007 #1 sumncguy IS-IT--Management May 22, 2006 118 US I want to isolate the ip. How do I get sed to delete from the start of the line (^) up to and including the first period ? 52.10.206.137.156 52.10.211.16.3 52.10.213.35.1 checked Oreilly Sed and Awk Pocket ref and some cheets I hold .... Thanks
I want to isolate the ip. How do I get sed to delete from the start of the line (^) up to and including the first period ? 52.10.206.137.156 52.10.211.16.3 52.10.213.35.1 checked Oreilly Sed and Awk Pocket ref and some cheets I hold .... Thanks
Jan 31, 2007 Thread starter #2 sumncguy IS-IT--Management May 22, 2006 118 US sed '0,/RE/s//to_that/' file # change only the first match Doesnt work ... Upvote 0 Downvote
Jan 31, 2007 Thread starter #3 sumncguy IS-IT--Management May 22, 2006 118 US 's/[^*\.]*/ /1' .10.206.137.156 .10.211.16.3 .10.213.35.1 .10.213.35.4 .10.213.35.10 .10.218.253.19 .146.170.71.103 Gettin there ... Upvote 0 Downvote
's/[^*\.]*/ /1' .10.206.137.156 .10.211.16.3 .10.213.35.1 .10.213.35.4 .10.213.35.10 .10.218.253.19 .146.170.71.103 Gettin there ...
Jan 31, 2007 1 #4 PHV MIS Nov 8, 2002 53,708 FR And what about this ? sed 's!^[^\.]*\.!!' /path/to/input > output Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886 Upvote 0 Downvote
And what about this ? sed 's!^[^\.]*\.!!' /path/to/input > output Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
Jan 31, 2007 Thread starter #5 sumncguy IS-IT--Management May 22, 2006 118 US Works great .... Thanks .. but like to understand what Im using ... ^ = line starts with [] = match one from a set * = match zero or one preceding \ = literal I just dont see how to read it ... Upvote 0 Downvote
Works great .... Thanks .. but like to understand what Im using ... ^ = line starts with [] = match one from a set * = match zero or one preceding \ = literal I just dont see how to read it ...
Jan 31, 2007 #6 feherke Programmer Aug 5, 2002 9,540 RO Hi sumncguy said: * = match zero or one preceding Click to expand... Actually, it is zero or more. The question mark ( ? ) means zero or one. Feherke. http://rootshell.be/~feherke/ Upvote 0 Downvote
Hi sumncguy said: * = match zero or one preceding Click to expand... Actually, it is zero or more. The question mark ( ? ) means zero or one. Feherke. http://rootshell.be/~feherke/