Search Results

Search: Posts Made By: durden_tyler
1,795
Posted By durden_tyler
Using Perl only for determining line counts just...
Using Perl only for determining line counts just does not seem to be an efficient way of doing things.
You will have more points of failure in your script. Also, more code means more to...
6,333
Posted By durden_tyler
I am not familiar with scl but by looking at the...
I am not familiar with scl but by looking at the "QuickStart" page of the "softwarecollections.org" website, it might be mandatory to specify "bash" at the end of that "scl" command(?)


scl...
3,135
Posted By durden_tyler
That's because you are using a regular expression...
That's because you are using a regular expression for FS that works differently than you (probably) think it does.
This part:[^,]* matches "0 or more occurrences of a character other than comma"....
4,002
Posted By durden_tyler
A very un-awk-like and more Perl-like script. :) ...
A very un-awk-like and more Perl-like script. :)

I added the sort routine because array iteration doesn't return the elements in order.
(Definitely not a good idea for large arrays.)

Note that...
3,283
Posted By durden_tyler
If Perl is an option, then here's a sample...
If Perl is an option, then here's a sample program:



$
$ cat -n process_files.pl
1 #!/usr/bin/perl
2 use strict;
3
4 # Set the file names
5 my $search_file =...
Forum: Programming 01-03-2019
2,635
Posted By durden_tyler
First of all - thank you very much for providing...
First of all - thank you very much for providing the CREATE TABLE and INSERT statements. Those really help!
If you have MySQL version < 8.0.2, then you could find the previous level by joining the...
Forum: Programming 08-27-2018
1,113
Posted By durden_tyler
Not sure if I understood the "o/p values are...
Not sure if I understood the "o/p values are dynamic" part, but see if this helps:


SQL>
SQL> SELECT * FROM mytable;

A B STATUS
---------- ---------- ----------
Insert ...
Forum: Programming 08-27-2018
2,003
Posted By durden_tyler
What you want are the "rank()" or "dense_rank()"...
What you want are the "rank()" or "dense_rank()" analytic functions.
They could be referred to as "window functions" or "OLAP functions" in DB2 and some of them are available in DB2 9.7 at least....
1,775
Posted By durden_tyler
It's actually working correctly. The !~...
It's actually working correctly.
The !~ operator returns true if the pattern match fails.
The =~ operator returns true if the pattern match succeeds.

You may want to take note that the !...
Forum: Programming 05-05-2018
58,218
Posted By durden_tyler
The following was tested on DB2 Express-C Version...
The following was tested on DB2 Express-C Version 11.1 on a Centos 7 Virtual Machine.


[db2inst1@r2d2-centos7 data]$
[db2inst1@r2d2-centos7 data]$ cat -n dec2bin.sql
1 --
2 ...
1,235
Posted By durden_tyler
Upon searching about this topic in the Internet,...
Upon searching about this topic in the Internet, I found that the "read" command may be unable to read a line that is not terminated by a newline.
However, I could not test it in my Cygwin Bash on...
2,131
Posted By durden_tyler
One way to do it would be to keep appending and...
One way to do it would be to keep appending and "building" two different strings - one for all users and the other for all user role assignments inside the while loop.
Once you're done with the...
5,668
Posted By durden_tyler
The Perl script will not work either because the...
The Perl script will not work either because the numeric part of the header columns moved to the left of the underscore ("_") instead of the right.

So, the index to compare after the "split"...
7,733
Posted By durden_tyler
In a Perl program, you'd accept the input log...
In a Perl program, you'd accept the input log file name (if so desired), open it, loop/process through it and then close it.
Here's a short program called "process_log.pl".
Hopefully the inline...
2,751
Posted By durden_tyler
Add an "order by" clause to your query and that...
Add an "order by" clause to your query and that should sort the data the way you want.
2,561
Posted By durden_tyler
Yes, from your other Perl related posts, I do get...
Yes, from your other Perl related posts, I do get the impression that you are trying to use the regexes for too many things. That should be avoided.
However, for this particular piece of code, I...
4,076
Posted By durden_tyler
Thank you for testing it for various inputs and...
Thank you for testing it for various inputs and posting the Perl version.
I could not find a working Perl 5.10 version to test it, so am unable to reproduce the bug.
However, after searching on...
6,980
Posted By durden_tyler
It's a "metacharacter" or a "shorthand character...
It's a "metacharacter" or a "shorthand character class" in a regular expression.
Any book, blog or webpage on regular expressions should mention it.

Here's the Wikipedia page on regular...
6,980
Posted By durden_tyler
If you are using Vim (as per your 1st post...
If you are using Vim (as per your 1st post above), then Vim understands "\s" for whitespace. At least Vim versions 7 and higher.

Try:


:g/^\s*#/d
To check the version of your Vim editor, type...
1,671
Posted By durden_tyler
This line: char_to_ix = { ch:i for i,ch in...
This line:

char_to_ix = { ch:i for i,ch in enumerate(chars) }
creates a Dictionary called "char_to_ix" that has for its keys, each character from the list "chars". The corresponding values are...
5,792
Posted By durden_tyler
You may want to check a few things: 1) Are...
You may want to check a few things:

1) Are you connecting to the correct schema ("darwin_ext")?
2) Will the schema "darwin_ext" own the procedure "prc_synonym"?
3) Did you check that the...
1,990
Posted By durden_tyler
Please mention the Python version you're using. ...
Please mention the Python version you're using.
Since the difference between your two programs is the "input()" function, it should be clear that the "input()" function is the problem.

From your...
2,561
Posted By durden_tyler
That's wrong! The regex looks for "a non-digit...
That's wrong!
The regex looks for "a non-digit followed by one or more digits" ("\D\d+").
Line numbers 2 and 3 do not have that, so it will not match.
Line number 4 has that, so it will match.

...
2,162
Posted By durden_tyler
The explanation was for the part in red in my...
The explanation was for the part in red in my post; I thought the post was clear about the erroneous part.
3,243
Posted By durden_tyler
You're almost there. Just keep in mind that awk...
You're almost there.
Just keep in mind that awk splits each line of file1 into 7 tokens ($1 through $7) and file2 into 2 ($1 and $2).


$
$ awk 'NR == FNR{a[$1] = $2;next}; {print $0, $7 in...
Showing results 1 to 25 of 358

 
All times are GMT -4. The time now is 01:24 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy