Search Results

Search: Posts Made By: chill3chee
16,073
Posted By Chubler_XL
I believe IBM connect direct uses a proprietary...
I believe IBM connect direct uses a proprietary protocol which is separate to and incompatible with SFTP.


SFTP runs over SSH and is used on thousands of systems around the world that don't have...
4,939
Posted By MadeInGermany
awk has automatic type conversion. The !...
awk has automatic type conversion.
The ! operator is a boolean that is rather a number (being 1 or 0) than a string, so there is a decent hint to treat the variable as a number.
In border cases...
4,939
Posted By RudiC
As I said - usage alone, be it for assignment or...
As I said - usage alone, be it for assignment or reference in an index, takes the value as is. Only evaluation, e.g. for a boolean expression or a numerical computation, converts the string to a...
4,939
Posted By MadeInGermany
Comparing with a string should work as well. ...
Comparing with a string should work as well.
echo "abc|0e123456789|xyz|1234|kdkd|dfs" | awk -F "|" '{ if ($2=="") { print $2 " is empty or NULL " } else { print $2 " is not empty "}}'
4,939
Posted By RudiC
Try a string conversion: echo...
Try a string conversion:
echo "abc|0e123456789|xyz|1234|kdkd|dfs" | awk -F "|" '{ if ( ! ($2 "")) { print $2 " is empty or NULL " } else { print $2 " is not empty "}}'
0e123456789 is not empty
...
1,549
Posted By Scrutinizer
Why are you using echo `cat output.html` ...
Why are you using
echo `cat output.html`
rather than
cat output.html
The first leaves all kinds of characters open to interpretation by the shell ..

How does that work with sendmail? What do...
2,913
Posted By bakunin
I think i got it, but i ask thread-o/p to...
I think i got it, but i ask thread-o/p to confirm. The presentation of his problem was perhaps a bit off from optimal:

There is ONE file with some database statements:

CREATE OR REPLACE VIEW...
2,913
Posted By Don Cragun
I agree wholeheartedly with the idea of using a...
I agree wholeheartedly with the idea of using a single invocation of awk instead of one invocation of sed for each line in a file. But, we don't have enough data to properly process the needed...
2,913
Posted By RudiC
Why don't you read file1 and spool_file just once...
Why don't you read file1 and spool_file just once each instead of file1 once per line in spool_file?
awk 'NR==FNR {T[$1]; next} {for (t in T) if ($0 ~ t) $0 = "--" $0} 1' file2 file1
CREATE OR...
2,913
Posted By RavinderSingh13
Hello chill3chee, I am still not clear about...
Hello chill3chee,

I am still not clear about your requirements, let's say variable line=TAB1_COL1, then following may help you in same.
Similarly you could use this following in your whileloop.
...
4,880
Posted By Yoda
Try running without silent mode:- sqlplus -s...
Try running without silent mode:-
sqlplus -s username/password@servername <<EOF

to
sqlplus username/password@servername <<EOF
4,880
Posted By vgersh99
{ sqlplus -s username/password@servername <<EOF...
{
sqlplus -s username/password@servername <<EOF
...
EOF
} > ${drctry}/${v_timestamp}_unix_sql_log.txt
3,251
Posted By RudiC
That was a hell of a specification to understand...
That was a hell of a specification to understand - not sure I did to its entirety. Anyway, try
awk -F "@" '
BEGIN {FMT1 = "%s%s\tSUM(CASE WHEN T1.%s=T2.%s THEN 1 ELSE 0 END) %s_%s"
FMT2...
5,498
Posted By Aia
An alternative in Perl: perl -ple...
An alternative in Perl:
perl -ple 'BEGIN{$\=$/=";\n"} s/\n/ /g' chill3chee.file
5,498
Posted By bakunin
You might - especially as a beginner - want to...
You might - especially as a beginner - want to make life easier for you and write real sed programs instead of one-liners only experts can decipher. It is like starting to learn the double toe-loop...
5,498
Posted By MadeInGermany
Your sed needs to substitute all \n where the...
Your sed needs to substitute all \n where the preceding characters is not a ;
sed -e ':a' -e 'N' -e '$!ba' -e 's/\([^;]\)\n/\1/g' fileThe file must fit into memory.
The following does an early...
5,498
Posted By RudiC
It's appending N ext lines and branching back to...
It's appending N ext lines and branching back to label L until it finds the ; , then branches to X , replaces \n with spaces and prints the resulting line.
5,498
Posted By RudiC
Why do you insist on sed and aren't happy with...
Why do you insist on sed and aren't happy with the awk solution?

Try
sed ':L; /;$/bX; N; bL; :X; s/\n/ /g' file
Table1@Table2@SELECT COL1, COL2,COL3, COL4,COL5 FROM TABLE1 INNER JOIN TABLE2 ON...
7,424
Posted By RudiC
There shouldn't be any NR == FNR nor NR != FNR; I...
There shouldn't be any NR == FNR nor NR != FNR; I simply put in FNR == 1 to exclude the header line(s). The scriptlet should work on any number of files supplied to it as one single stream of data...
7,424
Posted By RudiC
Make (and test) the combination of $1, $2, and $3...
Make (and test) the combination of $1, $2, and $3 unique:
awk '
FNR == 1 {next
}
!T[$1,$2,$3]++ {v_array[$1 OFS $2]=v_array[$1 OFS $2] ? v_array[$1 OFS $2] "," $3 : $3
...
22,401
Posted By Scrutinizer
Interesting. I had a look at this and it appears...
Interesting. I had a look at this and it appears this behavior is with any character, not just "@", but also for "*", "a" or "b".

I only saw this with AIX and HPUX awk..

A possible explanation...
22,401
Posted By MadeInGermany
You are right, some nawk derivates require awk...
You are right, some nawk derivates require
awk 'BEGIN {FS="[@]"; RS=";"} {print $3}' join_conditions.txtThe RS=";" works multi-line, but the FS="@" treats line feeds as a field delimiter.
You see...
22,401
Posted By MadeInGermany
Interesting, nawk variants treat an FS="@" in a...
Interesting, nawk variants treat an FS="@" in a way that line feeds are counted aw well.
Work-around:
awk -F"[@]" 'BEGIN {RS=";"} {print $3}' < join_conditions.txt
or
awk 'BEGIN {FS="\@"; RS=";"}...
1,506
Posted By RudiC
This may point you in a direction:awk ' $4 ==...
This may point you in a direction:awk '
$4 == "DIRECT" {IX = $1 OFS $5
if ($3 $7 ~ /DATE.*CHAR\(6/)
str="SUM(CASE WHEN...
1,599
Posted By Yoda
Try: awk ' NR == FNR { ...
Try:
awk '
NR == FNR {
A[$1]
next
}
{
for ( k in A )
print "create or replace view vw_tbl_" k "...
Showing results 1 to 25 of 25

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