Search Results

Search: Posts Made By: rossi
3,757
Posted By Aia
$ perl -pe 's/\n/ / unless ($. % 6) == 0' file ...
$ perl -pe 's/\n/ / unless ($. % 6) == 0' file
Name = abc HPScore = 6.00 HMScore = 7.99 HSScore = 7.73 Pre avg = 2.90 Pre bind ene =1.09
Name = djhf HPScore = 16.00 HMScore = 17.99 HSScore = 17.73...
3,757
Posted By Franklin52
Try this: awk 'NR % 6 {printf $0 FS; next}1' ...
Try this:
awk 'NR % 6 {printf $0 FS; next}1' file
1,753
Posted By Scrutinizer
Try for file in *.txt do { read; IFS=\|...
Try
for file in *.txt
do
{ read; IFS=\| read nr rest;} < "$file"
if [ "$nr" ]; then
mv "$file" "${file}${nr}"
fi
done
1,741
Posted By RudiC
For your second problem, how about this:awk ...
For your second problem, how about this:awk 'NR==FNR {T[$2]=$0; next}
$2 in T {print $0, T[$2]; delete T[$2]; next}
{print $0, "- - - -"}
...
2,120
Posted By Scrutinizer
Yes that is a totally different thing....
Yes that is a totally different thing. Eleborating on RudiC's suggestion, try:
awk '{for(i=1; i<=NF; i++) if(NR==FNR) {if($i==s) A[i]} else if(i in A) $i=s}NR>FNR' s="0 0" FS='\t' OFS='\t' file file...
2,120
Posted By Scrutinizer
Hi, sure: awk ' $0~s { ...
Hi, sure:
awk '
$0~s { # if the line contains the search string in variable s
$2=s # set the second field to that string
for(i=4; i<=NF;...
2,120
Posted By Scrutinizer
Hi, try: awk '$0~s{$2=s; for(i=4; i<=NF; i++)...
Hi, try:
awk '$0~s{$2=s; for(i=4; i<=NF; i++) $i=s}1' s="0 0" FS='\t' OFS='\t' file
1,722
Posted By RudiC
Try this and remove echowhen happy:for FN in...
Try this and remove echowhen happy:for FN in $(grep -Eli "can.t|cannot|cancelled" *.txt); do NFN=$(grep id $FN); echo mv $FN ${NFN#id*:*}.can.txt; done
mv a1.txt 73254.can.txt
mv c3.txt...
1,502
Posted By Chubler_XL
How about this: awk 'NR==FNR{ C[NR]=$1...
How about this:

awk 'NR==FNR{
C[NR]=$1 " " $2
L[C[NR]]=0
next
}
{
for (t in C) {
split(C[t],v," ")
if($1>=v[1] && $1<=v[2])
L[C[t]]+=$2
}
}
END {
...
Showing results 1 to 9 of 9

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