Search Results

Search: Posts Made By: yan1
3,983
Posted By vgersh99
something along these lines to start with: awk...
something along these lines to start with:
awk -v OFS='\t' -f yan.awk refFile tstFile
where yan.awk is:

BEGIN {
n=split("2 5 7 10", binA)
printf("%s%s", "BIN", OFS)
for(i=1;i<=n; i++)...
1,270
Posted By Aia
perl -ple '$p=$_; s/(\d+)/$1+1/e; $_="$p $_"'...
perl -ple '$p=$_; s/(\d+)/$1+1/e; $_="$p $_"' example
or
perl -ple '$p=$_; s/(\d+)(?=])/$1+1/e; $_="$p $_"' example
1,270
Posted By Don Cragun
Let's be clear here... RudiC's code worked...
Let's be clear here... RudiC's code worked perfectly for the problem you presented.

Now you have presented a different problem. And that problem is not clearly stated. We are all supposed to...
1,270
Posted By RudiC
Try awk '{split ($1, T, "[][]"); print $1 " " ...
Try
awk '{split ($1, T, "[][]"); print $1 " " T[1] "[" ++T[2] "]" }' file
a[4] a[5]
b[4] b[5]
c[4] c[5]
Showing results 1 to 4 of 4

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