Ok i have researched this a little and coming across a few problems.
1. When this code is used.
Its doing a total word count and not a line by line echo with the line number then the amount of words.
2. so i tried this.
and still the wc is not going line by line im thinking it because wc is a built in function is this correct? if so what is an alternative i can use. Also with both word counts wc -w it is skipping the first line regardless of what is in it.
Thanks
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... (2 Replies)
Hi all, I am trying to write a command that can help me count the number of lines in the /etc/passwd file ending in bash.
I have read through other threads but am yet to find one indicating how to locate a specifc word at the end of a line. I know i will need to use the wc command but when i... (8 Replies)
I would like to cut words based on the word count of a line. This over here inspired me with some ideas but I wasn't able to get what I needed.
https://www.unix.com/shell-programming-scripting/105841-count-words-each-line-file-using-xargs.html
If the line has 6 words I would like to use this.... (8 Replies)
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:... (1 Reply)
Hi All,
Hope you guys had a wonderful weekend
I have a scenario where in which I have to read a file line by line
and check for few words before redirecting to a file
I have searched the forum but,either those answers dint work (perhaps because of my wrong under standing of how IFS... (6 Replies)
I have a file: file.txt, which contains the following data in it.
This is a file, my name is Karl, what is this process, karl is karl junior, file is a test file, file's name is file.txt
My name is not Karl, my name is Karl Joey
What is your name?
Do you know your name and... (3 Replies)
Hi Folks :)
I have a .txt file with thousands of words. I'm trying to sort the lines in order based on number of words per line.
Example
from:
word
word word word
word word
word word word word
word
word word word
word word
to desired output:
word (2 Replies)
Hello,
I have been working on Awk/sed one liner which counts the number of occurrences of '|' in pipe separated lines of file and delete the line from files if count exceeds "17".
i.e need to get records having exact 17 pipe separated fields(no more or less)
currently i have below :
awk... (1 Reply)
I am trying to figure out to find word count of each word from my file
sample file
hi how are you
hi are you ok
sample out put
hi 1
how 1
are 1
you 1
hi 1
are 1
you 1
ok 1
wc -l filename is not helping , i think we will have to split the lines and count and then print and also... (4 Replies)
Discussion started by: mirwasim
4 Replies
LEARN ABOUT ULTRIX
swap_fi
swapsex(3) Library Functions Manual swapsex(3)Name
swap_word, swap_half, swap_filehdr, swap_aouthdr, swap_scnhdr, swap_hdr, swap_fd, swap_fi, swap_sym, swap_ext, swap_pd, swap_dn, swap_opt,
swap_aux, swap_reloc, swap_ranlib - swap the sex of the specified structure
Syntax
#include <sex.h>
#include <filehdr.h>
#include <aouthdr.h>
#include <scnhdr.h>
#include <sym.h>
#include <symconst.h>
#include <cmplrs/stsupport.h>
#include <reloc.h>
#include <ar.h>
long swap_word( word )
long word;
short swap_half( half )
short half;
void swap_filehdr( pfilehdr, destsex )
FILHDR *pfilehdr;
long destsex;
void swap_aouthdr( paouthdr, destsex )
AOUTHDR *paouthdr;
long destsex;
void swap_scnhdr( pscnhdr, destsex )
SCNHDR *pscnhdr;
long destsex;
void swap_hdr( phdr, destsex )
pHDRR phdr;
long destsex;
void swap_fd( pfd, count, destsex )
pFDR pfd;
long count;
long destsex;
void swap_fi( pfi, count, destsex )
pFIT pfi;
long count;
long destsex;
void swap_sym( psym, count, destsex )
pSYMR psym;
long count;
long destsex;
void swap_ext( pext, count, destsex )
pEXTR pext;
long count;
long destsex;
void swap_pd( ppd, count, destsex )
pPDR ppd;
long count;
long destsex;
void swap_dn( pdn, count, destsex )
pRNDXR pdn;
long count;
long destsex;
void swap_opt( popt, count, destsex )
pOPTR popt;
long count;
long destsex;
void swap_aux( paux, type, destsex )
pAUXU paux;
long type;
long destsex;
void swap_reloc( preloc, count, destsex )
struct reloc *preloc;
long count;
long destsex;
void swap_ranlib( pranlib, count, destsex )
struct ranlib *pranlib;
long count;
long destsex;
Description
All routines that swap headers take a pointer to a header structure to change the byte's sex. The destsex argument lets the swapsex rou-
tines decide whether to swap bitfields before or after swapping the words in which they occur. If destsex equals the hostsex of the machine
you are running on, the flip happens before the swap; otherwise, the flip happens after the swap. Although not all routines swap struc-
tures containing bitfields, the destsex is required.
The routine takes a pointer to an aux entry and a type, which is a ST_AUX_* constant in cmplrs/stsupport.h. The constant specifies the
type of the aux entry to change the sex of. All other routines are passed a pointer to an array of structures and a count of structures to
have the byte sex changed. The routines and are macros declared in sex.h. Only the include files that describe the structures being
swapped have to be included.
See Alsogethostsex(3)
RISC swapsex(3)