Search Results

Search: Posts Made By: LaTortuga
4,014
Posted By LaTortuga
MUCH faster, THANK YOU!!!
MUCH faster, THANK YOU!!!
4,014
Posted By LaTortuga
a_vect='1 2 1 2 1' b_vect='0;1;2;3;4' ...
a_vect='1 2 1 2 1'
b_vect='0;1;2;3;4'
c_vect='5;6;7;8;9'

desired output:

d_vect='0;6;2;8;4'

Hope that helps :), let me know if you need any further clarification
4,014
Posted By LaTortuga
Using Awk to efficiently substitute values using 3 vectors
I'm trying to efficiently combine the fields of two vectors (vectors b and c) into a new vector (vector d) as defined by instructions from a 3rd vector (vector a). So vector a has either a 1 or 2 in...
43,255
Posted By LaTortuga
I get: 3 2 1 I guess maybe i just...
I get:
3
2
1

I guess maybe i just copied the code of the two initial examples incorrectly? I'll play around with it some more and see if i can get it working.
43,255
Posted By LaTortuga
Basically, the output would just remain the same...
Basically, the output would just remain the same with no lines being swapped...I looked around and that "-v" command for awk, is only in certain versions of awk, so I might not be able to use it in...
43,255
Posted By LaTortuga
I had trouble getting either of these to work...
I had trouble getting either of these to work (i'm probably running it in the wrong shell)...I was able to get the latter to work by passing my variables from bash into the awk statement using...
43,255
Posted By LaTortuga
Thanks that works perfectly!:D
Thanks that works perfectly!:D
43,255
Posted By LaTortuga
I understand what that does...but I was hoping to...
I understand what that does...but I was hoping to switch lines var with var1. This switches var with var+2 and var1 with var1+2...If this code isn't built for that...then don't worry about trying to...
43,255
Posted By LaTortuga
Right, so now this code switches line "var"...
Right, so now this code switches line "var" (which for this example is set at 3), with a line two below it...but how do I switch line "var" with say another line defined by another variable, say...
43,255
Posted By LaTortuga
Awesome! is there any way to make this code...
Awesome! is there any way to make this code dynamic? I wanted to put some shell variables in here...For example, If I wanted to start with line $x instead of 3, I would start by replacing NR==3 with...
43,255
Posted By LaTortuga
I'm sorry, but I'm new to unix and am not...
I'm sorry, but I'm new to unix and am not familiar with perl...in that script, where do i tell the script what file to sort...also, how do i tell it which lines to swap?
43,255
Posted By LaTortuga
Swapping or switching 2 lines using sed
I made a script that can swap info on two lines using a combination of awk and sed, but was hoping to consolidate the script to make it run faster. If found this script, but can't seem to get it to...
Showing results 1 to 12 of 12

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