Been struggling with a problem, I have been trying to do this in awk, but am unable to figure this out, I think arrays have to be used, but unsure how to accomplish this.
I have a input file that looks like this:
141;ny;y;g
789;ct;e;e
23;ny;n;u
45;nj;e;u
216;ny;y;u
7;ny;e;e
1456;ny;e;g... (3 Replies)
Guys,
OK so i have been trying figure this all all day, i guess its a pretty easy way to do it.
Right, so i have to column of data which i have gotten from one huge piece of data. What i would like to do is to put both of these into one array using awk. Is this possible??
If so could... (1 Reply)
Dear Scripting experts,
I have a problem which i cannot get my head around and wondered if anyone can help me. I have two files "file1" and "file2" and i want to replace column one from file 1 with column one with file2.(where file two has many columns). see example.. ive tried to use cut and... (4 Replies)
Hi,
I have spent the afternoon trawling Google, Unix.com and Unix in a Nutshell for information on how awk arrays work, and I'm not really getting too far.
I ahve a batch of code that I am pretty sure can be better managed using awk, but I'm not sure how to use awk arrays to do what I'm... (1 Reply)
Hi,
I have requirement to fetch lines with a particular character in one column
e.g.
2.5M asdsad
3.5M sadsadas
12323M ssdss
i tried following so far
#echo 2.3M asdsad | nawk -F " " '{print substr($1,length($1))}'
M
So far i have tried following
# echo 2.3M asdsad | nawk... (4 Replies)
I have a file like below.
colA^col2^col3^col4^col5
aa^11^aaa^a1a^111^aa*
bb*^22^bbb*^bb2^222^bb
cc^33^ccc*^3cc^333^ccc
dd^44^d*dd*^d4d^444^ddd
ee^55^e*ee^e5e*^555^e*e
NOTE: '^' is the field separator.
I need to get the output as
colA^col2^col3^col4^col5
aa^11^aaa^a1a^111^aa... (5 Replies)
Hi to all,
I write this time to ask for different syntax or ways of arrays within awk and uses.
Since I don't know how actually could work and the real potencial of awk arrays, I look for a proactive reply/help in order to get
more information than it seems I'm trying to get.
I think I... (2 Replies)
Hi, buddies
I am new to shell scripting and trying to solve a problem. I read about arrays in awk that they are quite powerful and are associative in nature.
Awk Gurus Please help!
I have a file:
Id1 pp1 0t4 pp8 xy2
Id43 009y black
Id6 red xy2
Id12 new pp1 black
I have... (5 Replies)
Array A contains lines of numbers from files. Array B contains number of fields for each line of each file.
I want to run on array A. To do that I need to know the number of fields for each file in array A (because each line doesn't have the same NF).
The NF is in array B, problem is: I don't... (6 Replies)