10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I want to check my data quality. I want to output the lines with non-number. I used the grep command:
grep '' myfile.csv
Since my file is csv file, I don't want to output the lines with comma. And I also don't want to output "." or space. But I still get the lines like the following:... (8 Replies)
Discussion started by: twotwo
8 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
Hi All,
I have a file a.txt, content as mentioned below:
22454750
This data in this control file and
I have a variable called vCount which contains a number.
I need to extract the 22454750 from the above file and compare with the variable vCount. If match fine or else exit.
... (5 Replies)
Discussion started by: Arun Mishra
5 Replies
4. Shell Programming and Scripting
Hi,
I have a problem when doing calculations in awk.
I want to add up a few numbers and output the result.
testfile:
48844322.87
7500.00
10577415.87
3601951.41
586877.64
1947813.89
$ awk '{x=x+$1};END{print x}' testfile
6.55659e+07The problem is the number format. It should show... (3 Replies)
Discussion started by: Subbeh
3 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
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)
Discussion started by: trey85stang
8 Replies
9. 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
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