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 Chriss Miller 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 feherke

  1. feherke

    Buttons not aligned after another button is clicked

    Hi Probably because the elements with id btnEdit and btnSelect are a elements which by default are inline elements. When you toggle their visibility you change their display to block. Try to not do that : selectbtn.style.display = "inline"; // Show button editbtn.style.display = "inline"; //...
  2. feherke

    Newbie question

    Hi That is CMD problem, not Awk problem. You need to fix your quoting : [ ] ╭─pair─╮ ╭───────pair────────╮ ▼ ▼ ▼ ▼ awk -F, [highlight palegoldenrod]"{nvar="[/highlight]test[highlight palegoldenrod]"; print $1 nvar $2}"[/highlight] tt.txt In...
  3. feherke

    sed regex not working

    Hi Pretty sure it never worked exactly like that, as there is syntax error due to too many slashes ( / ). Do not let yourself confused by the fact that both the s command and the regular expression address are using slashes as delimiters. They are completely separate things : As they...
  4. feherke

    sed regex not working

    Hi I would use an address to split the regular expression in 2 less complex ones : address command ( in lines matching this ) ( do this ) ╭────────────┴───────────╮ ╭──────────┴────────╮ sed '/^prod:admin:batch:daily:/ s/:server1$/:server2/'...
  5. feherke

    How can I escape $1 and && in a SED command

    Hi $1 needs no escaping as it has no special meaning. ( The placeholder for the 1st captured group is \1. ) & can be escaped by prefixing it with a backslash : \&. So should be : sed -i 's/# UserParameter=/UserParameter=systemd.unit.is-active,systemctl is-active --quiet $1 \&\& echo 1 ||...
  6. feherke

    solved - lowercase between quotes "xxx"

    Hi There you concatenated the 3 field. print then out as separate fields. I mean, put comma ( , ) between them, so they get output with output field separator between them. If you not want to change the separators, set the OFS ( output field separator ) to the same as FS ( field separator )...
  7. feherke

    Need to compare two tables and list the differences

    Hi Instead of union all you will need except. That sounds more like a task for triggers instead. Feherke. feherke.github.io
  8. feherke

    comma function for Indian number system...

    Hi Thinking again, would be simpler and faster with a for loop and substr() : function comma(n , i) { for (i = index(n, ".") ? index(n, ".") - 3 : length(n) - 2; i > 1; i -= 2) { n = substr(n, 0, i - 1) "," substr(n, i) } return n } Feherke. feherke.github.io
  9. feherke

    comma function for Indian number system...

    Hi There is nothing special. Let us rewrite it abit : function comma(n , new_n) { new_n = gensub(/([[:digit:]])([[:digit:]]{3}$|[[:digit:]]{2},)/, "\\1,\\2", 1, n) while (n != new_n) { n = new_n new_n = gensub(/([[:digit:]])([[:digit:]]{3}$|[[:digit:]]{2},)/...
  10. feherke

    comma function for Indian number system...

    Hi For integers this should do it for any size : function comma(n , nn) { while (n != nn = gensub(/([[:digit:]])([[:digit:]]{3}$|[[:digit:]]{2},)/, "\\1,\\2", 1, n)) { n = nn } return n } For fractional part I did not got the rule. Feherke. feherke.github.io
  11. feherke

    file availability getline way

    Hi Maybe my memories are failing, as I can not reproduce it right now, but I have a feeling that also met it with print when writing to file. But I would say on file/pipe input/output operations. Feherke. feherke.github.io
  12. feherke

    file availability getline way

    Hi Dumb thing as according to operator precedence should be fine, but in reality you have to add parentheses : awk 'BEGIN{ month=202303 print getline < ("file"month) <0 ? "Not Available" : "Available" }' Feherke. feherke.github.io
  13. feherke

    What means ($_ =~ m/\ &lt;.*\ &gt;/g) ? (perl)

    Hi Those are 2 different metacharacters : . means any character * means the previous entity 0 or more times You can find them documented in the perlre manual's Metacharacters section. Some examples : 'abc' =~ m/<.*>/   # not matches, presence of < and > is mandatory 'a><bc' =~ m/<.*>/ # not...
  14. feherke

    How to send 2 select from mysql database in email like tables

    Hi First of all, never user input data directly interpolated in SQL statement. That way you make your code vulnerable to SQL injection attacks. The Bobby Tables site explains the problem and the solution in simple terms. Apparently there are user 2 completely different data access solutions...
  15. feherke

    How to send 2 select from mysql database in email like tables

    Hi Hard to understand what are you doing there. In the 1st code how does the $message variable get its value ? In the 2nd code how do the $date, $c_user, $to, etc variables get their values ? Probably would be better to show us the code that is not working so we can tell what the problem is...

Part and Inventory Search

Back
Top