10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I have some code that works more or less. This is called by a make file to adjust some hard-coded definitions in the src code. The script generated some values by looking at some of the src files and then writes those values to specific locations in other files. The awk code is used to... (3 Replies)
Discussion started by: LMHmedchem
3 Replies
2. Shell Programming and Scripting
Hello,
I am new to AWK and in UNIX in general. I am hoping you can help me out here.
Here is my data:
root@ubuntu:~# cat circuits.list
WORD1
AA
BB
CC
DD
Active
ISP1
ISP NAME1
XX-XXXXXX1
WORD1
AA
BB
CC (9 Replies)
Discussion started by: tattoostreet
9 Replies
3. Shell Programming and Scripting
I am trying to output all lines in a file where $7 is less than 30. The below code does create a result file, but with all lines in the original file. The original file is tab deliminated is that the problem? Thank you :).
awk 'BEGIN{FS=OFS=","} $7 < 30 {print}' file.txt > result.txt... (3 Replies)
Discussion started by: cmccabe
3 Replies
4. Shell Programming and Scripting
Hello experts,
Shown below is the 2 column sample data(there are many data columns in actual input file),
Key, Data
A, 1
A, 2
A, 2
A, 3
A, 1
A, 1
A, 1
I need the below output.
Key, Data
A, 2
A, 2
A, 3
A, 1
A, 1
A, 1 (2 Replies)
Discussion started by: ks_reddy
2 Replies
5. Shell Programming and Scripting
How do I get the last NR of a csv file?
If I use the line
awk -F, '{print NR}' csvfile.csv
and there are 42 lines, I get:
...
39
40
41
42
How do I extract the last number, which in this case is 42?
---------- Post updated at 11:05 AM ---------- Previous update was at 10:57 AM... (1 Reply)
Discussion started by: locoroco
1 Replies
6. Shell Programming and Scripting
I have a CSV file with a variable number of fields per record. How do I print lines of a certain number of fields only? Several permutations of the following (including the use of escape characters) have failed to retrieve the line I'm after (1,2,3,4)...
$ cat myfile
1,2,3,4
1,2,3
$ # Print... (1 Reply)
Discussion started by: cs03dmj
1 Replies
7. Shell Programming and Scripting
Hi,
I need help in printing out the dates with the largest value in front of it using awk.
436 28/Feb/2008
436 27/Feb/2008
436 20/Feb/2008
422 13/Feb/2008
420 23/Feb/2008
409 21/Feb/2008
402 26/Feb/2008
381 22/Feb/2008
374 24/Feb/2008
360... (7 Replies)
Discussion started by: SIFA
7 Replies
8. Shell Programming and Scripting
Hi All
I have the input file OMAK_11.
OMAK 000002EXCLUDE 1341
OMAK 000002EXCLUDE 1341
OMAK 000002EXCLUDE 1341
OMAK 000003EXCLUDE 1341
OMAK 000003EXCLUDE 1341
OMAK 000003EXCLUDE ... (8 Replies)
Discussion started by: dhanamurthy
8 Replies
9. Shell Programming and Scripting
Hi,
I'm using awk and sed to extract some data out from a text file. The text file consists of data over a million (prolly millions) of lines.
Question: Is there a limit of number of lines for awk and sed?
Thanks in advance. (2 Replies)
Discussion started by: 60doses
2 Replies
10. Shell Programming and Scripting
Can some body tell me how to print number of line from a particular file, with sed. ?
Input file format
AAAA
BBBB
CCCC
SDFFF
DDDD
DDDD
Command to print line 2 and 3 ?
BBBB
CCCC
And also please tell me how to assign column sum to variable.
I user the following command it... (1 Reply)
Discussion started by: maheshsri
1 Replies