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 Mike Lewis 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: *

  • Users: ng1
  • Order by date
  1. ng1

    put space after line

    Awesome. Works great. Thanks!!
  2. ng1

    put space after line

    I have a file something like this: 1234 $11 ABCD 1234 $5 XXXX 1299 $8 YYYY 1299 $6 FFCC 1299 $4 XCVB 1255 $1 XDCF 1255 $4 DDCC output desired: 1234 $11 ABCD 1234 $5 XXXX 1299 $8 YYYY 1299 $6 FFCC 1299 $4 XCVB 1255...
  3. ng1

    Pattern Deletion

    Works like a charm!! Thanks again!
  4. ng1

    Pattern Deletion

    Thanks PHV. I am checking it out right now.
  5. ng1

    Pattern Deletion

    I want to find a pattern. Then I want to compare string 4 of the line with the pattern in it to string 4 of the line above it. If those 2 strings match, I want to delete both lines. I know this will delete line with pattern and line above but I don't know how to add the step of matching up...
  6. ng1

    printing every nth line

    Daaaaaaa awk 'NR %150!=0' FILE
  7. ng1

    printing every nth line

    I got it from another post. This works: awk 'NR %150==0' FILE Now I am looking for a way to delete every 150th line.
  8. ng1

    printing every nth line

    I am using a sed statement to print every nth line. In the example below, I am printing every 15th line starting at line 15. What if I want to print every 150th line? Is there a way in awk or sed to not have to type out all the n's? It would not be practical to type 149 n's. sed -n...
  9. ng1

    find pattern, delete line with pattern and previous line and next line

    Works great phv! Thank you.
  10. ng1

    find pattern, delete line with pattern and previous line and next line

    sed '/FRM CHK 000000/{n;d;}’ filename I have tried this. It gets rid of the line after my pattern. I still need to get rid of the line before my pattern and the line with my pattern.
  11. ng1

    find pattern, delete line with pattern and previous line and next line

    awk '/FRM CHK 000000/ { print last; print; x = 1; next } x == 1 { print; x = 0 } { last = $0 } ' filename Somebody gave me this. It prints out the lines I am trying to delete. I need to change their code so it deletes those lines instead of printing them.
  12. ng1

    find pattern, delete line with pattern and previous line and next line

    I have a file that will sometimes contain a pattern. The pattern is this: FRM CHK 000000 I want to find any lines with this pattern, delete those lines, and also delete the line above and the line below.
  13. ng1

    print line below and line above

    I got it now. Thanks.
  14. ng1

    print line below and line above

    Thanks for your help. How would I put either of your scripts into a file that I can reference with awk -f ?
  15. ng1

    print line below and line above

    I have an awk script that is getting me part of what I need. It is giving me the lines with the criteria I have specified. { if (($3 == 0) || (($9 == 304) || ($9 == 306))) { print $0 } } Here is what else I need to do but don't know how. In the (($3==0) part, I ALSO need the line...
  16. ng1

    beginfile

    Is there a unix equivalent to :beginfile and :endfile For example, I am doing some editing with qedit. I want everything that is output from the qedit program to end up in a file. We are using HPUX (and this script would be run inside of a batch script and not manually) so it would look...
  17. ng1

    matching strings from 2 different files

    The join command did the trick. Thank you again taupirho! Here is the syntax that worked for me: join -j1 1 FILE1 FILE2
  18. ng1

    matching strings from 2 different files

    Yes, we are using Unix. I will check that command out. Thank you.
  19. ng1

    matching strings from 2 different files

    I have 2 files. In some of the records, string 1 will match but other strings will not. I want to be able to report out the records from file 2 where string 1 matches string 1 from file 1. Ex. FILE 1 111 222 333 444 555 FILE 2 111 AAAA 345 DKDK 4445 45TG 444 BBB In this...
  20. ng1

    help with if

    Annihilannic, Yea, I realized that after looking at the results. Thanks.

Part and Inventory Search

Back
Top