## [Solved] Count amount of times of appearing of character before a word?

Difficulty: Easy
The communication protocol NFC stands for Near-Field Control.
True or False?

# 1
[Solved] Count amount of times of appearing of character before a word?

Hello Is there a way to calculate how many times a particular symbol appeared in a string before a particular word.
So, I want to count number of occurence of"/" in this directory before the word dog lets say.
Cheers,

Bob
 FUTURE_EINSTEIN View Public Profile for FUTURE_EINSTEIN Find all posts by FUTURE_EINSTEIN
# 2
echo "Desktop/Myfiles/pet/dog/puppy" | awk -F\/ '{for(i=1;i<=NF;i++){if(\$i~/dog/)print i-1}}'
This User Gave Thanks to itkamaraj For This Post:
 itkamaraj View Public Profile for itkamaraj Find all posts by itkamaraj
# 3
This User Gave Thanks to shamrock For This Post:
 shamrock View Public Profile for shamrock Find all posts by shamrock
# 4
cheers!
 FUTURE_EINSTEIN View Public Profile for FUTURE_EINSTEIN Find all posts by FUTURE_EINSTEIN

## [Solved] Awk: count occurrence of each character for every field

Hi, let's say an input looks like: A|C|C|D A|C|I|E A|B|I|C A|T|I|B as the title of the thread explains, I am trying to get something like: 1|A=4 2|C=2|B=1|T=1 3|I=3|C=1 4|D=1|E=1|C=1|B=1 i.e. a count of every character in each field (first column of output) independently, sorted...

## Count same word which has come many times in single lines & pars

can i get a simple script for , Count same word which has come many times in single lines & pars Eg file would be == "Thanks heman thanks thanks Thanks heman thanks man" So resullt should be Thanks = 5 heman=2 man = 1 thanks in advance :) Please use code tags for code and...

## How do I count how many times a specific word appear in a file (ksh)?

Hi Please can you help how do I count the number of specific characters or words that appear in a file?

## how to count number of times each word exist in a file

I'm trying to count the number of times each word in the file exist for example if the file has: today I have a lot to write, but I will not go for it. The main thing is that today I am looking for a way to get each word in this file with a word count after it specifying that this word has...

## Count specific word or character per line

Hi, I need help regarding counting specific word or character per line and validate it against a specific number i.e 10. And if number of character equals the specific number then that line will be part of the output. Specific number = 6 Specific word or char = || Sample data:...

## How to format a character to look like an amount -solved

Hi All, I want to format the retrieved varchar2 value in the database to \$9,999,999,990.00 but remained as a character value. Is it possible? Example: 378273.23 to \$378,273.23 below is the code i want to implement: sqlplus -s \${USERNAME}/\${PASSWORD}@\${ORACLE_SID} << END1 >> \$LOGFILE...

## scripting - write a script that will count the number of times a particular word

hello everyone, I'm trying to learn some scripts but i cant get my head around two of them. 1. how can i write a script that will count the number of times a particular word is used in file? 2. how can i make a script that will take me to a web page from unix? if anyone could help it...

## Looking for a single line to count how many times one character occurs in a word...

I've been looking on the internet, and haven't found anything simple enough to use in my code. All I want to do is count how many times "-" occurs in a string of characters (as a package name). It seems it should be very simple, and shouldn't require more than one line to accomplish. And this is...

## count amount of accounts?

Hi, I am relatively new to Unix and trying to understand as much as I can. I would like to know if it's possible to count the total number of Unix accounts? If so, can the count be done from any working directory or does it have to be specific to where the accounts are based? Thanks!

## sed X amount of times - X is dynamic

I'm trying to make a bash shell script that will allow a user to modify another file based on input they give. Maybe someone can see what I'm doing wrong here. I'm still pretty new at this... Let's say my temp file contains this: 0 1 HELLO 3 4 And here's the code: old=(0 1 3 4) new=(zero...