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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by bigoldbulldog

  1. bigoldbulldog

    grep sed awk match only regexp1 AND regexp2 AND regexp3 ..

    Very doable with sed, but messy as a one-liner E.g. sed -n -e '/regexp1/{' -e '/regexp2/{' -e '/regexp3/p' -e '}' -e '}' filename or $ sed -n ' /regexp1/{ /regexp2/{ /regexp3/p } > }' filename Cheers, ND [smile]
  2. bigoldbulldog

    Fetching fields from multiple records using AWK ?

    Not requested, but sed is fun: sed ' /^[0-9]\{1,\}-[0-9]\{1,\}/{ s/;.*// N s/\n\([^ ]*\) .*/ \1/ N s/\n\([^ ]*\) .*/ \1/ }' sedFinal.txt Cheers, ND [smile]
  3. bigoldbulldog

    remove final \n from file

    Here's a way if you want to remove the terminal byte: dd if=inputfile ibs=1 count=$(expr "$(wc -c foo)" : "\([^ ]*\)*" - 1) of=outputfile Cheers, ND [smile]
  4. bigoldbulldog

    Preceding non-blank cell

    Yogi's solution does what I hoped. But instead of the performance hits of copying calculating down multiple cells and dealing with array-based formulas I've settled for the easier conditional formatting trick to match the font color to the background. Why do I think of harder solutions first...
  5. bigoldbulldog

    Preceding non-blank cell

    I'm trying this as cell's formula. I'd like the A6 field's value. Cheers, ND [smile]
  6. bigoldbulldog

    Preceding non-blank cell

    Does anyone know how to find the first preceding non-blank cell in a column based on some starting reference address? I'd like to do this using Excel built-in functions, not VBA (yeah, vba would be simple). Cheers, ND [smile]
  7. bigoldbulldog

    add 20 spaces on specific line

    Here's another sed method:sed -e :a -e 's/^.\{1,100\}$/& /;ta' Cheers, ND [smile]
  8. bigoldbulldog

    AWK: search and replace

    How about,for i in '*.sql'; do sed ' /_[FU]K/{ /_FK$/ N s/(\([^,]*\), \([^)]*\)/(\2, \1/ } ' $i > $i.tmp done Cheers, ND [smile]
  9. bigoldbulldog

    table

    Really good one (PHV)! Cheers, ND [smile]
  10. bigoldbulldog

    table

    sed can still a good alternative if the pattern stays consistent. sed 's/[a-z]\{2,\}_[0-9]\{1,\}=//g' or even: sed 's/.._[0-9]\{1,\}=//g' Cheers, ND [smile]
  11. bigoldbulldog

    Match and Select

    If your version of grep has the -f option you could try out this one-liner. grep -f /path/to/keyfile /path/to/datafile Cheers, ND [smile]
  12. bigoldbulldog

    REQ: Help with parsing please

    Oh, if you still need to filter the status number from to 1-200 then ammend the filter portion awk '$11=="status" && $12>=1 && $12<=200 {... Cheers, ND [smile]
  13. bigoldbulldog

    REQ: Help with parsing please

    Are the status and the number strings in the same columns at all times? Is the data in order? If yes, e.g. $2 & $3, then this is super easy.awk '/status [12]/print $8 > $2 $3".txt";{if(/status 200/)exit}' error.txt Cheers, ND [smile]
  14. bigoldbulldog

    Pass variable as insert with SED.

    For a sed/subshell solution I found:sed "\$i\\ $(sed '$!s/$/\\/' ng_pass) " pass_test Cheers, ND [smile]
  15. bigoldbulldog

    Salary Negotiations

    You might reasses salary since 6-8 months later puts you squarely in a new fiscal year. You could also justify a renegotion saying you never fully talked through medical, 401 k contributions, etc. You should also re-explore the position with the hiring manager to see how the position has...

Part and Inventory Search

Back
Top