10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
i need to be able to count the number of single quotes ' in the entire string below:
"description":"DevOps- Test VM's, System Admins Test VM's ",
awk can most likely do this, but here's my attempt using egrep:
echo "${STRING}" | egrep -wc '"'"\'"'"'
or
echo "${STRING}" | egrep -wc... (11 Replies)
Discussion started by: SkySmart
11 Replies
2. Shell Programming and Scripting
Hi all,
Can someone help me in getting the following o/p
I/p:... (7 Replies)
Discussion started by: Sri3001
7 Replies
3. Shell Programming and Scripting
I am trying to display the output of ls and also print the number of characters in EVERY file name. This is what I have so far:
#!/bin/sh
for x in `ls`; do
echo The number of characters in x | wc -m
done
Any help appreciated (1 Reply)
Discussion started by: LinuxNubBrah
1 Replies
4. Shell Programming and Scripting
HI,
i have a file like this
t.txt
f1|_f2|_
f1|_f2|_
f1|_f2|_
as if col delimiter is |_ and row delimiter |_\n
trying to count number of records using awk
$ awk 'BEGIN{FS="|_" ; RS="~~\n"} {n++}END{print n} ' t.txt
7
wondering how can i count this to 3 ?
thx (9 Replies)
Discussion started by: aksforum
9 Replies
5. UNIX for Dummies Questions & Answers
Hello,
I have a string like this 0:1:2:0:2:2:4:0:0:0:-200:500......
what i want is to break down how many different characters are there and their count. For example for above string it should display
0 - 5 times
1 - 1 times
2 - 3 times
4 - 1 times
.
.
.
I am stuck in writing... (8 Replies)
Discussion started by: exit86
8 Replies
6. UNIX for Dummies Questions & Answers
Hello,
I'm new to using AWK and would be grateful for some basic advice to get me started.
I have a file consisting of 10 fields. Initially I wish to calculate the number of . , ~ and ^ characters in the 9th field ($9) of each line. This particular string also contains alphabetical... (6 Replies)
Discussion started by: Olly
6 Replies
7. Shell Programming and Scripting
Gurus,
Need little guidance.
I have A.txt and B.txt file. B.txt file contains Unique strings.
Sample content of B.txt file for which i cut the fourth column uniquely and output directed to B.txt file
And A.txt file contains the above string as a fourth column which is last column.
So A.txt... (7 Replies)
Discussion started by: Shirisha
7 Replies
8. Shell Programming and Scripting
Hi there, I have some user input in a variable called $VAR, and i need to ensure that the string is 5 or less characters .... does anybody know how i can count the characters in the variables ?
any help would be great, cheers (2 Replies)
Discussion started by: rethink
2 Replies
9. UNIX for Dummies Questions & Answers
I need to count the number of files which have a search string, but counting the file only once
if search string is found.
eg: File1: Please note that there are 2 occurances of "aaa"
aaa
bbb
ccc
aaa
File2: Please note that there are 3 occurances of "aaa"
aaa
bbb
ccc... (1 Reply)
Discussion started by: sudheshnaiyer
1 Replies
10. UNIX for Dummies Questions & Answers
I have two files I want to compare, one is a list of variables and the other is a text file COBOL program.
Basically what I want to do is display only those variables that appear in the COBOL program only once. However I would also accept a count of each variable as it appears in the COBOL... (2 Replies)
Discussion started by: Keith Gergel
2 Replies