Sponsored Content
Top Forums UNIX for Beginners Questions & Answers awk or sed script to count number of occurrences and creating an average Post 303039224 by kshitij on Thursday 26th of September 2019 10:33:15 AM
Old 09-26-2019
Awk or sed script

Yes Rudic , yes all 1's and 0's starting from field 2

Thanks
Kshitij
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to count number of occurrences of a "|" from a variable?

I have a variable, var="some1|some2|some3" I want to know how many "|" are in $var. When I say echo $var | grep -c '|' I am getting only 1 :confused: :confused: :confused: ? (4 Replies)
Discussion started by: jingi1234
4 Replies

2. UNIX for Dummies Questions & Answers

count number of fields not using SED or AWK

hi forums i need help with a little problem i am having. i need to count the number of fields that are in a saved variable so i can use that number to make a different function work properly. is there a way of doing this without using SED/AWK? anything would be greatly appreciated (4 Replies)
Discussion started by: strasner
4 Replies

3. Shell Programming and Scripting

Count the number of occurrences of the word

I am a newbie in UNIX shell script and seeking help on this UNIX function. Please give me a hand. Thanks. I have a large file. Named as 'MyFile'. It was tab-delmited. I am told to write a shell function that counts the number of occurrences of the ord “mysring” in the file 'MyFile'. (1 Reply)
Discussion started by: duke0001
1 Replies

4. Shell Programming and Scripting

Count the number of occurrences of a pattern between each occurrence of a different pattern

I need to count the number of occurrences of a pattern, say 'key', between each occurrence of a different pattern, say 'lu'. Here's a portion of the text I'm trying to parse: lu S1234L_149_m1_vg.6, part-att 1, vdp-att 1 p-reserver IID 0xdb registrations: key 4156 4353 0000 0000 ... (3 Replies)
Discussion started by: slipstream
3 Replies

5. Shell Programming and Scripting

count and number instances of a character in sed or awk

I currently use LaTeX together with a sed script to set cloze test papers for my students. I currently pepend and equals sign to the front of the words I want to leave out in the finished test, =perpendicular, for example. I am able to number the blanks using a variable in LaTeX. I would like to... (8 Replies)
Discussion started by: maouinin
8 Replies

6. Shell Programming and Scripting

Help with Unix and Awk to count number of occurrences

Hi, I have a file (movies.sh), this file contains list of movies such as I want to redirect the movies from movies.sh to file_to_process to allow me process the file with out losing anything. I have tried Movies.sh >> file_to_process But I want to add the row number to the data... (2 Replies)
Discussion started by: INHF
2 Replies

7. Shell Programming and Scripting

Count occurrences in awk

Hello, I have an output from GDB with many entries that looks like this 0x00007ffff7dece94 39 in dl-fini.c 0x00007ffff7dece97 39 in dl-fini.c 0x00007ffff7ab356c 50 in exit.c 0x00007ffff7aed9db in _IO_cleanup () at genops.c:1022 115 in dl-fini.c 0x00007ffff7decf7b in _dl_sort_fini (l=0x0,... (6 Replies)
Discussion started by: ikke008
6 Replies

8. Shell Programming and Scripting

Script to count word occurrences, but exclude some?

I am trying to count the occurrences of ALL words in a file. However, I want to exclude certain words: short words (i.e. <3 chars), and words contained in an blacklist file. There is also a desire to count words that are capitalized (e.g. proper names). I am not 100% sure where the line on... (5 Replies)
Discussion started by: Cronk
5 Replies

9. Shell Programming and Scripting

awk Group By and count string occurrences

Hi Gurus, I'm scratching my head over and over and couldn't find the the right way to compose this AWK properly - PLEASE HELP :confused: Input: c,d,e,CLICK a,b,c,CLICK a,b,c,CONV c,d,e,CLICK a,b,c,CLICK a,b,c,CLICK a,b,c,CONV b,c,d,CLICK c,d,e,CLICK c,d,e,CLICK b,c,d,CONV... (6 Replies)
Discussion started by: Royi
6 Replies

10. Shell Programming and Scripting

Count the number of string occurrences to display 0 entries in output

Hello Friends, Can somebody assist an issue I am having? I have a separate file with a list of account ids XXX200B02Y01 XXX200B03Y01 XXX200B05Y01 XXX200B07Y01 XXX200B08Y01 I call the file, and run an egrep against a directory and logfiles AccountID=$(cat... (2 Replies)
Discussion started by: liketheshell
2 Replies
XFM_DEV(5)								XFM								XFM_DEV(5)

NAME
/etc/X11/xfm/xfm_dev - xfm device configuration DESCRIPTION
When starting xfm(1) - the X file and application manager - reads this file to determine mount and umount commands for specific directo- ries. FORMAT
One entry per line. Lines starting with a hash (#) and empty lines are ignored. Each line consists out of three or four fields, separated by colons (:). Backslashes and colons within those fields have to be escaped using backslashes. FIELDS
directory The first field describes which directory this entry is about. If this this directory or and child directory of this is opened, while no other one is open, the mount command is executed. If the last file window showing this directory or a child thereof, the unmount command is executed. This field can also be the special string GETFSENT, which is described in a special paragraph below. mount command The second field is the command to execute for mounting. It is given the shell as one argument after a -c. unmount command The third field is the command to execute for unmounting. It is given the shell as one argument after a -c. icon The fourth field is optional. It is only used to specify an icon for the 0 No icon field is equivalent to an icon field containing dev_disk.xpm, which differs from an empty icon field. (See xfm(5)). automatic configuration via GETFSENT If the first field of an entry is the special string GETFSENT, and the systen xfm was compiled on had a fstab.h file, the getfsent(3) func- tion is used to get mount point information. Every mount point which contains a mount option starting with user. (like user, or users) for which no specification does yet exists is added to the list. mount and unmount command These commands are expanded with a space and the directory in question and the result is handled a in the normal case. This needs some fixing with directories containing spaces. icon field The icon field can in this case be appended by an arbitrary number of rules of the form ,fstype=iconname If the filesystem has type fstype, the icon iconname is used instead. EXAMPLES
/media/cdrom:mount /media/cdrom:umount /media/cdrom:cdrom.xpm /floppy:mount /floppy:umount /floppy GETFSENT:mount:umount:dev_disk.xpm,iso9660=dev_cdrom.xpm,ext2=bla.xpm FILES
$HOME/.xfm/xfm_dev Unless otherwise specified in the X resources, this is the first location xfm looks for this file. /etc/X11/xfm/xfm_dev Unless otherwise specified in the X resources, this file is tried when the previous could not be read. /etc/fstab This is the file getfsent most likely gets its information from. SEE ALSO
xfm(1), mount(8), getfsent(3). xfm 20 April, 2006 XFM_DEV(5)
All times are GMT -4. The time now is 01:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy