Thanks everyone for all your help! Feherke, the sed ended up being the simplest way to do what I need. You're right, I just had to escape the backslashes. Here's what I used:
sed -n '/Backup of "\\\\PCABC/,/Server -/p' logfile.txt
This pulls out just the "PCABC" section.
The logfile.txt was...
Thank you Feherke. Sed would be fine, too, but it didn't seem to work (probably because my "start" and "stop" strings have spaces and backslashes). Here is a clipping from the input text and I want to pull out all the lines between the:
Backup of "\\PCABC\C: "
and the next occurence of...
Hi everyone,
I have an HTML log file which I would like to strip the HTML tags away, then search for a "begin" string, then print that and all subsequent lines until it reaches the "end" string. Kind of awking out a block of text. I've made a little 'C' program which can strip the HTML...
One last thing on this:
Is there a way to add a DOS return "^M" to the end of each line? When I open the cleaned-up file with notepad, its all run together and I'm afraid that the spam filter program may not deal with that correctly.
thanks,
Scott
My mistake, I'm sorry. I didn't realize that your suggestion did, indeed, print everything from the first "^>" as I need. My apologies and thank you very much for your help!
Thank you, CaKiwi, as well for the addition to remove the "^>"'s
Everyone here is so helpful; I really appreciate it...
Hi vlad,
Unfortunately, some lines in the forwarded section don't start with ">", so it would be nice to read in lines at a time and discard them until it reaches the first line beginning with ">", then print out that and all remaining lines including any more that do not start with ">".
Thank...
Hi everyone,
I am trying to cut away the *first* header information from a forwarded email file, then remove the ">" symbols from the beginning of each line in the remainder of the file to get back to the original email the person forwarded to me. This is all to feed into a bayesian SPAM...
Oop, my bad. I apologize, I missed it. I just thought that the bolded letters in the printf above were an HTML hiccup of the site here. Actually, it was a hiccup of my brain. That works perfect! Again, many thanks!
Scott
Hey PHV, Yeah, I just found that I forgot to put in the semi-colon before the printf. I added it and it worked great like Jean Pierre's example. Both ways work so slick. Thank you both for your help!
If anyone knows of a handy way to right-justify the number while keeping the system name...
Hey PHV,
I tried it and got the following error:
/cygdrive/c/docume~1/saw.TERNION/desktop-> domaxbackups.sh
awk: cmd. line:3: /Processed/{key=$2;gsub(/,/,"",key)printf("%s %s %s\n",key,sha
re,$2)}
awk: cmd. line:3: ^ syntax error
The syntax error is pointing...
That works great! Thank you so much for your help. I should have realized that I could just continue the pipe on into the sed. As long as we're on a roll here, is there a resonably handy way to pad the spaces between the system name/share and the size so that the size portion is right...
Thank you Jean Pierre, that works great for just a number, but actually, here is what I'm trying to do:
I'm using the following script to get only the pertinent information from a backup exec log file and sort it by size, big to small.
awk '/Backup of/{printf("%s...
I would like to add commas into numbers to make them more readable. Such as, when awk comes across a number, add commas to make "31231104990" into "31,231,104,990". Is this possible with awk or another program?
thanks, Scott
I'm trying to parse a BackupExec log file to simplify it down to just the system name and the amount backed up. I can grep out the needed lines, but the file also has the "verify" lines as well, which I don't need to see. How can I use awk (or something else) to print out everything that it...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.