Sponsored Content
Top Forums Shell Programming and Scripting Print the characters in a word Post 302140974 by chella on Wednesday 17th of October 2007 03:16:01 AM
Old 10-17-2007
Question Print the characters in a word

Hi,

How can I split the characters in a word?

For Eg:

If my input is:
command

my output should be:
c
o
m
m
a
n
d

Please help me in doing it so.

Regards,
Chella
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

how to get first two characters from a word

Hi guyz, suppose there is a variable a=sachin. I want to have letter 'c' from variable a. I am trying this awk 'substr(sachin,2,1)' but its not working. I cant user cut as it requires a file whereas i have a variable. (4 Replies)
Discussion started by: sachin.gangadha
4 Replies

2. Shell Programming and Scripting

deleting last characters of a word

Hi All is there a way to delete last n characters from a word like say i have employee_new i want to delete _new. and just get only employee I want this in AIX Shell scripting Thanks (3 Replies)
Discussion started by: rajaryan4545
3 Replies

3. UNIX for Dummies Questions & Answers

Script to search for a particular word in files and print the word and path name

Hi, i am new to unix shell scripting and i need a script which would search for a particular word in all the files present in a directory. The output should have the word and file path name. For example: "word" "path name". Thanks for the reply in adv,:) (3 Replies)
Discussion started by: virtual_45
3 Replies

4. UNIX for Dummies Questions & Answers

How to print line starts with specific word and contains specific word using sed?

Hi, I have gone through may posts and dint find exact solution for my requirement. I have file which consists below data and same file have lot of other data. <MAPPING DESCRIPTION ='' ISVALID ='YES' NAME='m_TASK_UPDATE' OBJECTVERSION ='1'> <MAPPING DESCRIPTION ='' ISVALID ='NO'... (11 Replies)
Discussion started by: tmalik79
11 Replies

5. Shell Programming and Scripting

How ti Grep for a word and print the next word

Hi can we grep for a word and print the next word of the greped word? ex:- create or replace function function_name create function function_name we should search for word "function" and output next word "function_name" from both lines. (3 Replies)
Discussion started by: manasa_vs
3 Replies

6. Shell Programming and Scripting

perl lwp find word and print next word :)

hi all, I'm new there, I'm just playing with perl and lwp and I just successfully created a script for log in to a web site with post. I have a response but I would like to have something like this: I have in my response lines like: <div class="sender">mimi020</div> <some html code.....>... (3 Replies)
Discussion started by: vogueestylee
3 Replies

7. Shell Programming and Scripting

Search for the word and exporting 35 characters after that word using shell script?

I have a file input.txt which have loads of weird characters, html tags and useful materials. I want to display 35 characters after the word description excluding weird characters like $$#$#@$#@***$# and without html tags in the new file output.txt. Help me. Thanx in advance. My final goal is to... (11 Replies)
Discussion started by: sachit adhikari
11 Replies

8. Shell Programming and Scripting

Search for the word and exporting 35 characters after that word using shell script

I have a file input.txt which have loads of weird characters, html tags and useful materials. I want to display 35 characters after the word "description" excluding weird characters like $&lmp and without html tags in the new file output.txt. Help me. Thanx in advance. I have attached the input... (4 Replies)
Discussion started by: sachit adhikari
4 Replies

9. Shell Programming and Scripting

[Solved] Search for a word and print the next word

Hi, I am trying to search for a word and print the next word. For example: My text is "<TRANSFORMATION TYPE ="Lookup Procedure">" I am searching for "TYPE" and trying to print ="Lookup Procedure" I have written a code like following: echo $line | nawk... (4 Replies)
Discussion started by: sampoorna
4 Replies

10. Shell Programming and Scripting

Search for a specific word and print only the word from the input file

Hi, I have a sample file as shown below, I am looking for sed or any command which prints the complete word only from the input file. Ex: $ cat "sample.log" I am searching for a word which is present in this file We can do a pattern search using grep but I need to cut only the word which... (1 Reply)
Discussion started by: mohan_kumarcs
1 Replies
WC(1)							    BSD General Commands Manual 						     WC(1)

NAME
wc -- word, line, and byte count SYNOPSIS
wc [-c | -m] [-Llw] [file ...] DESCRIPTION
The wc utility displays the number of lines, words, bytes and characters contained in each input file (or standard input, by default) to the standard output. A line is defined as a string of characters delimited by a <newline> character, and a word is defined as a string of char- acters delimited by white space characters. White space characters are the set of characters for which the iswspace(3) function returns true. If more than one input file is specified, a line of cumulative counts for all the files is displayed on a separate line after the out- put for the last file. The following options are available: -c The number of bytes in each input file is written to the standard output. -L The number of characters in the longest line of each input file is written to the standard output. -l The number of lines in each input file is written to the standard output. -m The number of characters in each input file is written to the standard output. -w The number of words in each input file is written to the standard output. When an option is specified, wc only reports the information requested by that option. The default action is equivalent to all the flags -clw having been specified. The following operands are available: file A pathname of an input file. If no file names are specified, the standard input is used and no file name is displayed. By default, the standard output contains a line for each input file of the form: lines words bytes file_name EXIT STATUS
The wc utility exits 0 on success, and >0 if an error occurs. SEE ALSO
iswspace(3) COMPATIBILITY
Historically, the wc utility was documented to define a word as a ``maximal string of characters delimited by <space>, <tab> or <newline> characters''. The implementation, however, didn't handle non-printing characters correctly so that `` ^D^E '' counted as 6 spaces, while ``foo^D^Ebar'' counted as 8 characters. 4BSD systems after 4.3BSD modified the implementation to be consistent with the documentation. This implementation defines a ``word'' in terms of the iswspace(3) function, as required by IEEE Std 1003.2 (``POSIX.2''). The -L option is a non-standard extension, compatible with the -L option of the GNU and FreeBSD wc utilities. STANDARDS
The wc utility conforms to IEEE Std 1003.2-1992 (``POSIX.2''). BSD
February 18, 2010 BSD
All times are GMT -4. The time now is 01:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy