awk or other way to find out number of occurrence of 7th character
Hi all,
I am looking for to filter out based on 7th character and list the number of occurrence based on the 7th character if p , d , o or m
1. if 7th character is p , Output should be: p_hosts = N
2. if 7th character is d , Output should be: d_hosts = N
3. if 7th character is o , Output should be: o_hosts = N
4. if 7th character is m, Output should be: m_hosts = N
Desired output should be:
Thanks in advance.,
---------- Post updated at 10:56 AM ---------- Previous update was at 10:51 AM ----------
Hi,
I need to find the number of occurrence of string in a file,
for ex:
>cat filename
abc
abc
def
ghi
ghi
ghi
ghi
abc
abc
>output would be
abc 4
def 1 (10 Replies)
I have a text file like this
...
B 16 1.340E+05
A 18 3.083E+02
Wu123 1.365E+02
...
I would like to get rid of the 7th character of each line if this is a space character.
Thank you,
Sarah (5 Replies)
Hi All,
Was wondering how I can do the following....
I have a String as follows
"ACCTRL000005022RRWDKKEEDKDD...."
This string can be in a file called tail.out or in a Variable called $VAR2
Now I have another variable called $VAR1="000004785" (9 bytes long), I need the content of... (5 Replies)
Hi
I have requirement to find nth occurrence in a file and capture data from with in lines (between lines)
Data in File.
<QUOTE>
<SESSION>
<ATTRIBUTE NAME='Parameter Filename' VALUE='file1.parm'/>
<ATTRIBUTE NAME='Service Name' VALUE='None'/>
</SESSION>
<SESSION>
<ATTRIBUTE... (6 Replies)
Hello, Experts,
I have a file with the first and second column connected together, and i want to use vi to seperate them (put a space in between).
Is there any command in vi would put a space after the 7th letter?
Thanks!
example:
0.981101.517
2.944101.517
4.907101.517 (10 Replies)
Hello
how to find last occurence of a string
for example in the following I want last occurence of '-' i.e. position 12
str="aa-bbb-cccc-ddd-ee"
my pupose is to get the string 'ee'
Thanks and Regards
Chetanz (5 Replies)
My file contains like this on 10 th line
NM1*IL*1*
awk '/NM1/{print NR}' *.dat
output is 10
awk '/NM1*IL*1*/{print NR}' *.dat
output is Nothing
but im expecting 10 on second code as well . (4 Replies)
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... (4 Replies)
How to find total number of special character in a column?
I am using awk -f "," '$col_number "*$" {print $col_number}' file.csv|wc -l but its not giving correct output. It's giving output as 1 even though i give no special character?
Please use code tags next time for your code and... (4 Replies)
Hi
I want to use awk to match where field 3 contains a number within string - then print the line and just the number as a new field.
The source file is pipe delimited and looks something like
1|net|ABC Letr1|1530|||
1|net|EXP_1040 ABC|1121|||
1|net|EXP_TG1224|1122|||
1|net|R_North|1123|||... (5 Replies)
Discussion started by: Mudshark
5 Replies
LEARN ABOUT NETBSD
newfs_v7fs
NEWFS_V7FS(8) BSD System Manager's Manual NEWFS_V7FS(8)NAME
newfs_v7fs -- construct a new 7th Edition(V7) File System
SYNOPSIS
newfs_v7fs [-FZ] [-B byte-order] [-n inodes] [-s sectors] [-V verbose] special
DESCRIPTION
newfs_v7fs builds a 7th Edition(V7) file system on the specified special. If it is a device, the size information will be taken from the
disk label and before running newfs_v7fs the disk must be labeled using disklabel(8); the proper fstype is ``Version 7''. Otherwise, the
size must be specified on the command line. V7 filesystem's block size and sector size are 512 byte. Disk address limits are 24 bit.
The following arguments are supported:
-B byte-order Specify the metadata byte order of the file system to be created. Valid byte orders are 'be', 'le', and 'pdp'. If no byte
order is specified, the file system is created in host byte order.
-F Create file system to a regular file (needs the -s option).
-n inodes This specifies the number of inodes for the filesystem. If the number of inodes exceeds 65536, it is reduced to 65536.
-s sectors Create file system with specified number of disk sectors.
-V verbose This controls the amount of information written to stdout:
0 No output.
1 Overall size, ilist size, endian and filename length.
2 A progress bar.
3
4 More verbose message.
The default is 3.
-Z Fill file with zeroes instead of creating a sparse file.
SEE ALSO disklabel(5), disktab(5), disklabel(8), diskpart(8)BSD April 29, 2011 BSD