Search Results

Search: Posts Made By: sammy777888
1,753
Posted By RudiC
Yes, you need a loop. How about for FN in...
Yes, you need a loop. How about
for FN in *.ph*; do TMP=${FN%_${FN#*_*_*_}}; NDTMP="NewDir${TMP#${TMP%%[0-9]*}}"; echo mkdir -p "$NDTMP"; echo mv "$FN" "$NDTMP"; doneremove the echoes when happy...
1,753
Posted By RudiC
Fortunately, it's working (for me). EDIT:...
Fortunately, it's working (for me).

EDIT: OK, let's be constructive. WHAT "is not working", and how? Please post data to work upon (execution logs, error messages). For me, this was the output:...
3,302
Posted By durden_tyler
You're almost there. Just keep in mind that awk...
You're almost there.
Just keep in mind that awk splits each line of file1 into 7 tokens ($1 through $7) and file2 into 2 ($1 and $2).


$
$ awk 'NR == FNR{a[$1] = $2;next}; {print $0, $7 in...
1,443
Posted By RudiC
shell variables are NOT available in awk. You...
shell variables are NOT available in awk. You need to use the -v option:
awk -vOLDMIN="$old_min" '{print OLDMIN}'

On top of vars not being available, with your syntax above you reference a field...
1,418
Posted By RavinderSingh13
Hello sammy777888, Not sure how above...
Hello sammy777888,

Not sure how above highlighted line has come because I can't see any relation of line PT|np_001300561.1 171202 from Input_file2 to Input_file1. If this is a typo then following...
1,418
Posted By Scrutinizer
Try: awk 'NR==FNR{A[$1]=$2; next} {print A[$1],...
Try:
awk 'NR==FNR{A[$1]=$2; next} {print A[$1], $0, A[$NF]}' file2 file1

Output:
171200 PT|np_496075.1 st|K92748.1 st|K89648.1 PT|np_001300561.1 171202
171648 PT|np_497284.1 st|K90752.1...
3,661
Posted By drl
Hi. The thread...
Hi.

The thread https://www.unix.com/shell-programming-and-scripting/259989-perl-script-read-string-file-1-find-replace-file-2-a.html contains a perl code for multiple replacement -- Aia and MIG...
10,921
Posted By MadeInGermany
I did some benchmarks, too. With sed the...
I did some benchmarks, too.
With sed the runtime grows exponentionally with abc.sed.
GNU sed, when abc.sed is >90 lines, is already slower than the perl solution in post#2.
For my tests I have...
Showing results 1 to 8 of 8

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