Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. Ternion

    print all lines between "start" and "stop" strings (inclusiv

    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...
  2. Ternion

    print all lines between "start" and "stop" strings (inclusiv

    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...
  3. Ternion

    print all lines between "start" and "stop" strings (inclusiv

    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...
  4. Ternion

    Read/skip lines in file until pattern found, then print remainder

    Thanks CaKiwi! The "\r" works great. thanks again, Scott
  5. Ternion

    Read/skip lines in file until pattern found, then print remainder

    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
  6. Ternion

    Read/skip lines in file until pattern found, then print remainder

    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...
  7. Ternion

    Read/skip lines in file until pattern found, then print remainder

    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...
  8. Ternion

    Read/skip lines in file until pattern found, then print remainder

    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...
  9. Ternion

    add commas into number for readability

    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
  10. Ternion

    add commas into number for readability

    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...
  11. Ternion

    add commas into number for readability

    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...
  12. Ternion

    add commas into number for readability

    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...
  13. Ternion

    add commas into number for readability

    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...
  14. Ternion

    add commas into number for readability

    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
  15. Ternion

    Print all lines until reach specific phrase, then ignore rest of lines

    Thank you CaKiwi, that worked great! I knew there had to be a way for awk to work like that. thanks again, Scott
  16. Ternion

    Print all lines until reach specific phrase, then ignore rest of lines

    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...

Part and Inventory Search

Back
Top