Search Results

Search: Posts Made By: GDC
1,088
Posted By rdrtx1
awk ' {lines[NR]=$0; if (NF > columns)...
awk '
{lines[NR]=$0; if (NF > columns) columns=NF}
END {
for (j=1; j<=NR; j++) {
split(lines[j], sensors, FS);
$0=sensors[1];
for (i=2; i<=columns; i++) {
...
1,160
Posted By RavinderSingh13
Hello GDC, Could you please go through...
Hello GDC,

Could you please go through following and let me know if this helps you.

awk -F';' ##### Making field separator as ";"
'NR==FNR ##### Checking NR==FNR...
1,160
Posted By Corona688
Yes, editing a huge file once as opposed to...
Yes, editing a huge file once as opposed to editing a huge file n times for n lines would certainly be preferable!

This should work efficiently for anywhere up to millions of sequences listed in...
900
Posted By Scrutinizer
Another approach.. Try: awk -F\; ' BEGIN {...
Another approach.. Try:
awk -F\; '
BEGIN {
split("bc=a: b: c: d: f: g:",L," ")
}
!/^@/{
print
next
}
{
gsub(/[cd]1:[^,]+,/,x,$2)
s=$1 FS
...
900
Posted By RudiC
I'm not sure your S006 output is correct as there...
I'm not sure your S006 output is correct as there should be a d: field in there. Tryawk '
/^@/ {for (i=NF; i>1; i--) {if ($i ~ /^[cd]1/) sub ($i FS, _)
if ($i...
1,902
Posted By Don Cragun
RudiC is correct; rdrtx1's script uses the array...
RudiC is correct; rdrtx1's script uses the array a[$1] to store both the computed value of the best measurement and the contents of the line containing the best measurement. It can't do both.
...
1,902
Posted By Yoda
awk ' { $1 = $1 ...
awk '
{
$1 = $1
V = $6 * $7
if ( $1 in A )
{
if ( A[$1] < V )
{
...
1,902
Posted By Don Cragun
Why doesn't your desired output (as shown in...
Why doesn't your desired output (as shown in outfile.txt) contain an entry for sensor M01072-5?
Yoda provided a solution that should be faster (and use a lot fewer resources) than your script. If...
1,902
Posted By Yoda
if ( $1 in A ) statement scans if field $1 in...
if ( $1 in A ) statement scans if field $1 in present in array A index.

To know more about this expression check: Scanning an Array...
Showing results 1 to 9 of 9

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