Admittedly, my awk code has a slight bug -- if there is odd number of lines, it will double up the last line. To be entirely correct, one should check whether getline grabs a line or not, and append only if it succeeds:
The awk command awk -F: '{print $1}' test1 gives the first columns of all the lines in file ,is there some command to get a particular column from particular line .
Any help is appreciated.
thanks arif (4 Replies)
hi,
i'm a newbie and this is my first post here. 'hope all of you fellow members are doing fine. so here is my first thread to ask for help on how to use awk language to do this task.
i have a file to process and after a series of other awk commands and shell scripts i managed to convert the... (11 Replies)
i have an output like this :
012008
25760883
022008
12273095
032007
10103
032008
10115642
042007
20952798
but i would like to have it like this
012008,25760883
022008,12273095
032007,10103
032008,10115642
042007,20952798 (4 Replies)
Hello.
I've been banging my head against walls trying to search a comma delimited file, using awk. I'm trying to search a "column" for a specific parameter, if it matches, then I'd like to print the whole line.
I've read in multiple texts:
awk -F, '{ if ($4 == "string") print $0 }'... (2 Replies)
Dear UNIX community,
I would like to to count characters from a specific row and have them displayed line-by-line.
I have a file called testAwk2.csv which contain the following data:
rabbit penguin goat
giraffe emu ostrich I would like to count in the middle row individually... (4 Replies)
Dear All,
I indeed your help for managing resarch data file.
for example I have,
data1.txt :
type of atoms z vz
Si 34 54
O 20 56
H 14 13
Si 40 17
O ... (11 Replies)
Hi everyone,
Here's my awk statement so far: awk '/TOTAL TYPE:/{print x;print};{x=$0}' file1 >file2
'file1' has too much proprietary data in it to include here, so let's go with the output from code above. It looks like this:
123456 JAMES T KIRK D ... (2 Replies)
Hi,
I have data with approximately 300 columns.
I want to add a column to the end of each column with the value "1".
Is there a way that I can do this is ´awk´ without having to specify each individual column.
For instance, my data looks like:
pvb 1 2 3 4 5 ....... 300
fdh 3 4 5 2 4 ......... (4 Replies)