Search Results

Search: Posts Made By: forevertl
2,845
Posted By MadeInGermany
There might be a performance problem also,...
There might be a performance problem also, because grep might do the comparisons one after the other, like a loop would do, for each line. Anchoring makes each comparison only a little faster.
If...
2,845
Posted By Scrutinizer
You could try putting those strings in a file,...
You could try putting those strings in a file, like so:

ILMN_2258774
ILMN_1700477
...
ILMN_1805992

Then you can extract like so:
grep -f stringfile test1>test2

For accuracy it would be...
4,035
Posted By Scrutinizer
Try: awk '{for(i=1; i<=NF; i++) $i+=0}1'...
Try:
awk '{for(i=1; i<=NF; i++) $i+=0}1' CONVFMT="%.3f" file
33,341
Posted By jim mcnamara
awk uses format specifiers very similar to C. ...
awk uses format specifiers very similar to C.

printf "%.3f %.3e\n", 1234.12345 1234.12345
1234.123 1.234e+03

So,
awk '{printf("%s %s %.3f %.3e\n", $1, $2, $3, $4)}' inputfile >...
33,341
Posted By Scrutinizer
Try: awk '{printf "%s %s %.3f %.3e\n", $1, $2,...
Try:
awk '{printf "%s %s %.3f %.3e\n", $1, $2, $3, $4}' file
or
awk '{$3=sprintf("%.3f",$3); $4=sprintf("%.3e",$4)}1' file
1,162
Posted By bakunin
I sense a slight ambiguity here and i want to...
I sense a slight ambiguity here and i want to clarify it before anything else:

do you want to wait for the completion of all the 20 commands before you start the next batch of twenty or do you...
1,159
Posted By Corona688
awk '$1 = $1 + 0' CONVFMT="%.3g" infile >...
awk '$1 = $1 + 0' CONVFMT="%.3g" infile > outfile
1,398
Posted By Scrutinizer
Another approach: awk 'NR>1{print $3 RS $5}'...
Another approach:
awk 'NR>1{print $3 RS $5}' file
1,398
Posted By blackrageous
If order of values don't matter, then something...
If order of values don't matter, then something like

awk 'BEGIN{getline}{printf("%s\n%s\n",$3,$5)} file.txt

or

awk 'BEGIN{getline}{printf("%s\n%s\n",$3,$5)} file.txt | sort


the...
2,185
Posted By rangarasan
cut
Hi,

Try this one,

cut -c75000-85000 file

Cheers,
Ranga:-)
1,243
Posted By Corona688
Not everyone has dos2unix, but everyone has tr.
Not everyone has dos2unix, but everyone has tr.
1,243
Posted By Corona688
These files are Windows text files full of...
These files are Windows text files full of carriage-return garbage and won't work properly with non-Windows tools until they're fixed.

tr -d '\r' < wingarbage > normaltext
3,334
Posted By Corona688
how about uname -a? ---------- Post updated...
how about uname -a?

---------- Post updated at 12:30 PM ---------- Previous update was at 11:26 AM ----------

Not knowing your system means I can't use the following 5-second solutions:
Shell...
1,983
Posted By alister
If the only commas in the input occur in that...
If the only commas in the input occur in that last field:

tr -s , \\n < file | awk 'NF>1 {p=$0} NF==1 {f=$0; $0=p; $NF=f} 1'

f=final field's value
p=prefix of records with common origin

...
1,983
Posted By daptal
You get the additional rows when you skip the...
You get the additional rows when you skip the '/^\s*$/' line.

The line /^\s*$/ means any line that just contains white spaces or empty

If you notice your input file the format is as follows...
1,510
Posted By sk1418
code: (without the header) awk...
code: (without the header)
awk 'NR>1{c3=$2*$2;c4=(1-$2)*(1-$2);c5=1-c3-c4;print $0,c3,c4,c5}' yourFile

output:
a 1 1 0 0
b 20 400 361 -760
c 30 900 841 -1740
d 3 9 4 ...
1,750
Posted By pludi
sed -e 's/\([ACGT][ACGT]\)/\1 /g' yourfile
sed -e 's/\([ACGT][ACGT]\)/\1 /g' yourfile
Showing results 1 to 17 of 17

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