I am not pretty sure about awk 'NF-1'. But the second one (awk '$2' infile) means, it will only show the records which have 2 or more fields, pupulated with strings. If you give awk '$4' infile, it will only output the records those have 4 or more fields. Please see below.
---------- Post updated at 07:37 PM ---------- Previous update was at 07:33 PM ----------
All,
I have a file with text as shown below. I want the o/p file with generated values in the first column as shown in the o/p file. Pls note that the size of my file is 6 GB. How do i do this ?
Input file
999999abcdef
999999ghijkl
999999mnopq
777777rosesarered
777777skyisblue
Output... (1 Reply)
Is there a way to tell awk to ignore the first 11 lines of a file?? example, I have a csv file with all the heading information in the first lines. I want to split the file into 5-6 different files but I want to retain the the first 11 lines of the file.
As it is now I run this command:
... (8 Replies)
Hi
am having a file which looks like this
i want to get unique values in column2 and sum up the corresponding column3 values and discard the column4 and then write the output in different file.
i.e the output has to be like
i.e
07-Jun-2009 919449829088 52 lessrv1
07-Jun-2009... (2 Replies)
Hi
I am new to Awk programming , i would appreciate if anyone help me with the below scenario
i have text file arranged in rows and columns like below
11004 04493384 26798 CASSI0000I Server manager initialization started
111004 04493486 26798 CASSI4005I Retrieving ES... (7 Replies)
Hello,
For the input file, I am trying to split those records which have multiple values seperated by '|' in the last input field, into multiple records and each record corresponds to the common input fields + one of the value from the last field.
I was trying with an example on this forum... (4 Replies)
I'm using a shell script to manipulate a data file. I have a large file with two sets of data samples (tracking memory consumption) taken over a long period of time, so I have many samples. The problem is that all the data is in the same file so that each sample contains two sets of data.... (2 Replies)
Dear Gents,
Could you please help me to solve this problem.
I am getting the average of a column for same duplicate records in this case locate in column 1. The average is computed from column 5 from all duplicate records in column 1. Normallly the values in column 5 is constant so the... (3 Replies)
Hi Guys,
I am having below tables in oracle
T1
ID F_TYPE F_AMT DATE_COL
1 F 6 11-Feb-16
1 D 2 11-Feb-16
1 D 2 11-Feb-16
1 F 6 11-Feb-16
1 F 2 12-Mar-16
1 D 3 12-Mar-16
1 F 4 10-Apr-16
1 F 4 11-Apr-16
1 D 1 11-Apr-16
T2
ID START_DATE END_DATE F_ID FLAG... (0 Replies)
The awk below executes and update the desired field in my first awk. However, the white space between
nonsynonymous SNV in $9 is being split into tabs and my attempt to correct this does not update the field
unless it is removed. I am not sure what I am doing wrong? Thank you :).
file1
... (4 Replies)
I recently had to remove a number of columns from a sorted copy of a file, but couldn't get the cut command to take fields out, just what to keep. This is the only thing I could find as an example, but could it be simplified?
tstamp=`date +%H%M%S`
grep -v "T$" filename |egrep -v "^$" |sort... (3 Replies)