10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I need to sum up the values in field nr 5 in a data file that contains some file listing. The 5th field denotes the size of each file and following are some sample values.
1,775,947,633
4,738
7,300
16,610
15,279
0
0
I tried the following code in a shell script.
awk '{sum+=$5} END{print... (4 Replies)
Discussion started by: krishmaths
4 Replies
2. Shell Programming and Scripting
Hi Experts,
Please support
I have below data in file in comma seperated, but 4th column is containing comma in between numbers, bcz of which when i tried to parse the file the column 6th value(5049641141) is being removed from the file and value(222.82) in column 5 becoming value of column6.
... (3 Replies)
Discussion started by: as7951
3 Replies
3. Shell Programming and Scripting
Hi All,
I am new to shell scripting i am trying to convert the listner.log to csv which can be inturn converted to excel for easy reading.
i used this command
awk '/SID=/ && /HOST=/ && /PORT=/ && /USER=/ {
i=match($0,"SID="); i=i+RLENGTH; h0=substr($0,i);
i=match(h0,")");... (6 Replies)
Discussion started by: skoshekay
6 Replies
4. Shell Programming and Scripting
I am trying to use awk to format the file below, which is tab-delimited. The desired out is space delimited and is in the order of
$9 $13 $2 $10-$11.$10 and $11 are often times multiple values separated by a comma, so the value in $10 is combined with the first value from
$11 using the comma.... (5 Replies)
Discussion started by: cmccabe
5 Replies
5. UNIX for Dummies Questions & Answers
Hi everyone,
i have a file that I had grep'd from something else lets call it file1.txt which consists variable files and lines due to different scenarios/inputs
1782
9182
fe35
ac67
how can I print this in this manner?
1782,9182,fe35,ac67
also if i had piped the new output... (2 Replies)
Discussion started by: prodigy06
2 Replies
6. Shell Programming and Scripting
Hi Guys,
I want to remove commas from just the numbers in the file.
So both sides of the comma should be numbers.
Input file
Johan
1,234 nb
jan
123,3
hi, hello, bye
12,345,54
hejhej
Desired output:
Johan
1234 nb
jan (6 Replies)
Discussion started by: Johanni
6 Replies
7. Shell Programming and Scripting
Guys,
Need you help, i have a a file content that look like this.
Nokia 3330 <spaces><spaces><more spaces>+76451883874
Nokia 3610 +87467361615
so on and so forth,
- there are so many spaces in between.
- e.g.... (5 Replies)
Discussion started by: shtobias
5 Replies
8. UNIX for Advanced & Expert Users
Hi experts,
I need urget help! I have the a text file with this format:
Types of fruits
Name of fruits
1,1
Farm_no,1
apple,1
pineapple,1
grapes,1
orange,1
banana,1
2,2--->this is the record seperator
Farm_no,2
apple,1
pineapple,1
grapes,3
orange,2
banana,1
3,3--->this is the... (2 Replies)
Discussion started by: natalie23
2 Replies
9. Shell Programming and Scripting
Hi experts,
I need urget help! I have the a text file with this format:
Types of fruits
Name of fruits
1,1
Farm_no,1
apple,1
pineapple,1
grapes,1
orange,1
banana,1
2,2--->this is the record seperator
Farm_no,2
apple,1
pineapple,1
grapes,3
orange,2
banana,1
3,3--->this is the... (1 Reply)
Discussion started by: natalie23
1 Replies
10. UNIX for Dummies Questions & Answers
Hi,
I have a requirement wherein, I need to validate a user input of the numbers that are comma separated.
E.g . The input should be in the format 1,2,3...n (count of numbers is not known) . The user has to mention the input in this format, else it should exit from the program.
... (5 Replies)
Discussion started by: 12345
5 Replies