Search Results

Search: Posts Made By: RudiC
222
Posted By RudiC
That's because of the different lengths of $6 (1...
That's because of the different lengths of $6 (1 or 2) resulting in a different FS count after it, so sometimes "ALA" shows up in $8, sometimes in $9, and the fields to follow as well.
222
Posted By RudiC
As Scrutinizer posted, modifying the field...
As Scrutinizer posted, modifying the field separator is responsible, as it changes field numbering. $6 now assumes the values "C", "N", "O", "CA", "CB", whose count is 5.
103
Posted By RudiC
This problem has been solved umpteen times in...
This problem has been solved umpteen times in these fora. Did you bother to search, or look into the proposals given below under "More UNIX and Linux Forum Topics You Might Find Helpful"?

...
149
Posted By RudiC
Thanks for sharing your final code. Glad you...
Thanks for sharing your final code. Glad you found a solution. Pls be aware that this is NOT coming close to the desired output in post #1.
149
Posted By RudiC
You definitely need to split your pipeline into...
You definitely need to split your pipeline into single commands and analyse each one of them separately in order to identify what is going wrong. I don't know the voronota command, what it requires,...
149
Posted By RudiC
Difficult to believe. Show what you did and the...
Difficult to believe. Show what you did and the results thereof.
149
Posted By RudiC
Try enclosing the expression in double quotes (as...
Try enclosing the expression in double quotes (as you did with "'R<$AAA>'" ).
149
Posted By RudiC
Those header "underlines" indicate that the first...
Those header "underlines" indicate that the first two colums are 60 characters wide and thus won't fit into linesize 60.You can

- trim / chop the columns to sensible lengths
- increase line size...
135
Posted By RudiC
Make it egrep "...
Make it

egrep " (2248/24000|1836/25000|1836/27000) " file, then.For your second condition, you'll need to specify the entire pattern:

egrep...
832
Posted By RudiC
/.../ in awk is a regex constant, so it tries to...
/.../ in awk is a regex constant, so it tries to match two uppercase "A" (AA)in your above case. Drop the slashes to match the contents of variable AA.
144
Posted By RudiC
Try also sed '1bL; 10bL; b; :L; p;...
Try also
sed '1bL; 10bL; b; :L; p; s/{+\|+}\|\[-.*-]//g;' file


EDIT: removed p; leftover from testing / debugging:

sed '1bL; 10bL; b; :L; s/{+\|+}\|\[-.*-]//g;' file
832
Posted By RudiC
Of course you don't get any output as the $AAA...
Of course you don't get any output as the $AAA shell variable is not expanded within single quotes. Why not use the standard awk interface as shown before? And, don't test $0 for a match but $2 only.
832
Posted By RudiC
An array element, as is any variable in awk, is...
An array element, as is any variable in awk, is created on first reference as an empty entity. Empty, as does 0, represents the boolean value FALSE. So OCC[$4] on its first occurrence, is created,...
330
Posted By RudiC
May I paraphrase your request: You want file2's...
May I paraphrase your request: You want file2's sequences to prevail and file1's sequences inserted only if there's no equivalent in file2. If so, try
tr $'\n>' $' \n' <file1| grep -vf <(sed -n...
89
Posted By RudiC
Well, I can't see an error / failure. No...
Well, I can't see an error / failure. No "intermittend" behaviour. Data is from 10. June, and log (which seems to have worked) from 9. June. They can't possibly match.
236
Posted By RudiC
Then, please, discontinue this thread and reopen...
Then, please, discontinue this thread and reopen in https://www.unix.com/homework-and-coursework-questions/ after having read the rules (https://www.unix.com/misc.php?do=cfrules) (esp this...
202
Posted By RudiC
No surprise "it is not working" as none of your...
No surprise "it is not working" as none of your attempts is addressing your problem if at all syntactically correct.



awk 'FNR == NR {SRCH[$3 "-" $2]; next} $2 in SRCH {print ">" $0}' FS="[]-...
236
Posted By RudiC
Who forbids to use awk? Is this a homework /...
Who forbids to use awk? Is this a homework / classwork exercise, to which special rules apply?
468
Posted By RudiC
No, it suppresses lines that don't have a...
No, it suppresses lines that don't have a dependency met. Do you mean you need ALL dependencies met? Why not say so? What would the desired output look like (small but representative sample)?


...
102
Posted By RudiC
Your attempt to sort -t"|" -k1 is not enough, as...
Your attempt to sort -t"|" -k1 is not enough, as (man sort)
, so -k1 is equivalent to no key at all. Try sort -t"|" -k1,1 file
362
Posted By RudiC
Three comments on Peasant's fine proposal: -...
Three comments on Peasant's fine proposal:
- not all awk versions provide strftime(); gawk may be required.
- calling strftime() without a time stamp will return the system time; insert $1 for the...
362
Posted By RudiC
No surprise the execution of your script is a bit...
No surprise the execution of your script is a bit sluggish - you execute 16 processes per input line. As you are using awk anyhow, why not do the entire thing with it?
468
Posted By RudiC
More guessing than reading / understanding /...
More guessing than reading / understanding / knowing your spec, I came up with

awk '{D[$1,$2]++; for (n=split($6, T, ";"); n; n--) if (T[n] in D) print}' SUBSEP="/" file. Works?
372
Posted By RudiC
Try awk -F, ' NR == 1 {for (i=1;...
Try
awk -F, '
NR == 1 {for (i=1; i<=NF; i++) if ($i == SRCH) COL=i
HD = $1
}
FNR == 1 {FCNT++
HD = HD OFS SRCH
...
418
Posted By RudiC
Welcome to the forum. Why not extend the...
Welcome to the forum.


Why not extend the logics that you already apply, like
rev | cut | rev | cut -d"_" -f2-? But, this would require to create and run four processes per table name. Better to...
Showing results 1 to 25 of 500