Find word in a line and output in which line the word occurs / no. of times it occurred
I have a file: file.txt, which contains the following data in it.
HTML Code:
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 what it is?
When I'm running the following command to get line# of a word "is" in this file using the following command, it's giving me the output like:
HTML Code:
1:is
is
is
is
is
is
2:is
is
3:is
4:is
What command can I run to get the following output:
Greetings.
I am struggling with a shell script to make my life simpler, with a number of practical ways in which it could be used. I want to take a standard text file, and pull the 'n'th word from each line such as the first word from a text file.
I'm struggling to see how each line can be... (5 Replies)
Hi Folks !!!!!!!!!!!!!!!!!!!
My Requirement is.............
i have a input file:
501,501.chan
502,502.anand
503,503.biji
504,504.raja
505,505.chan
506,506.anand
507,507.chan
and my o/p should be
chan->3
i.e. the word which occurs maximum number of times in a file should be... (5 Replies)
Hi I have a text file like this name today.txt
the request has been accepted
the scan is successful at following time
there are no invalid packages
5169378 : map : Permission Denied
the request has been accepted
Now what i want do is
I want to search the today.txt file and
if i... (1 Reply)
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 folks,
have a look into the attachment, i am not familiar with unix, can you please help me in this regard.
thanks in advance, :)
regards,
Geeko (4 Replies)
I have a File with the below contents
File1
I have no prior experience in unix. I have just started to work in unix.
My experience in unix is 0. My Total It exp is 3 yrs.
I need to replace the first word in each line with the last word for example
unix have no prior experience in... (2 Replies)
I have a file that has the words I want to find in other files (but lets say I just want to find my words in a single file). Those words are IDs, so if my word is ZZZ4, outputs like aaZZZ4, ZZZ4bb, aaZZZ4bb, ZZ4, ZZZ, ZyZ4, ZZZ4.8 (or anything like that) WON'T BE USEFUL.
I need the whole word... (6 Replies)
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)
Hi there I am trying to figure out and understand what the syntax would be to egrep lines that have a word occur twice in a row. the two words obviously should have a space between them and also it has to be case sensitive which I believe grep is by deffault. the closest I have come is...
grep... (7 Replies)
Discussion started by: spo_2138
7 Replies
LEARN ABOUT HPUX
uuencode
uuencode(4) Kernel Interfaces Manual uuencode(4)NAME
uuencode - format of an encoded uuencode file
DESCRIPTION
Files output by consist of a header line followed by a number of body lines, and a trailer line. The command ignores any lines preceding
the header or following the trailer (see uuencode(1)). Lines preceding a header must not look like a header.
The header line consists of the word followed by a space, a mode (in octal), another space, and a string which specifies the name of the
remote file.
The body consists of a number of lines, each containing 62 or fewer characters (including trailing new-line). These lines consist of a
character count, followed by encoded characters, followed by a newline.
The character count is a single printing character, which represents an integer. This integer is the number of bytes in the rest of the
line, and always ranges from 0 to 63. The byte count can be determined by subtracting the equivalent octal value of an ASCII space charac-
ter (octal 40) from the character.
Groups of 3 bytes are stored in 4 characters, 6 bits per character. All are offset by a space to make the characters printable. The last
line may be shorter than the normal 45 bytes. If the size is not a multiple of 3, this fact can be determined by the value of the count on
the last line. Extra meaningless data will be included, if necessary, to make the character count a multiple of 4. The body is terminated
by a line with a count of zero. This line consists of one ASCII space.
The trailer line consists of the word on a line by itself.
SEE ALSO mail(1), uuencode(1), uucp(1).
uuencode(4)