How to del word by random input?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to del word by random input?
# 1  
Old 09-28-2010
How to del word by random input?

Hi,
I got big problem.
a line contains like this:

Hell "A,B,C", how to delete A or B or C by using sed or other tools?
I do not have any idea.
Many thanks.
# 2  
Old 09-28-2010
Code:
echo "Hello ABC" | sed 's/B//' 
# or
echo "Hello ABC" | tr -d 'B'

# 3  
Old 09-28-2010
Hi,thanks anyway
but i want to have like this results:
Hell "A,B,C,D" ----> after delte A get Hell "B,C,D"
Hell "A,B,C,D" ----> after delte B get Hell "A,C,D"
Hell "A,B,C,D" ----> after delte C get Hell "A,B,D"
Hell "A,B,C,D" ----> after delte D get Hell "A,B,C"

---------- Post updated at 08:52 PM ---------- Previous update was at 08:33 PM ----------

Hell "A,B,C,D"
printf "enter the letter you want to delete:"
read LETTER
-----------------------------------------------
then get that results,
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. 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

2. Shell Programming and Scripting

Need to generate a file with random data. /dev/[u]random doesn't exist.

Need to use dd to generate a large file from a sample file of random data. This is because I don't have /dev/urandom. I create a named pipe then: dd if=mynamed.fifo do=myfile.fifo bs=1024 count=1024 but when I cat a file to the fifo that's 1024 random bytes: cat randomfile.txt >... (7 Replies)
Discussion started by: Devyn
7 Replies

3. UNIX for Dummies Questions & Answers

Find EXACT word in files, just the word: no prefix, no suffix, no 'similar', just the word

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)
Discussion started by: chicchan
6 Replies

4. UNIX for Dummies Questions & Answers

del lines

i have file that looks like this: 031000503 2000049262784 LCK00000050 i want to look like this: 031000503 2000049262784 LCK00000050 i'd like to del 10-15 Please use code tags! (6 Replies)
Discussion started by: lawsongeek
6 Replies

5. Ubuntu

expect script for random password and random commands

Hi I am new to expect. Please if any one can help on my issue its really appreciable. here is my issue: I want expect script for random passwords and random commands generation. please can anyone help me? Many Thanks in advance (0 Replies)
Discussion started by: vanid
0 Replies

6. Shell Programming and Scripting

Find a word in input file

Hi, I had a input file containing, abcdefghij;20100903040607;1234567891;GLOBAL; abc123;20100903040607;12345;09;thestdf; def456;20100903040607;67891;04;bnkim; I need to search word GLOBAL in my file. If it is found then do something else do other thing How can i write if loop for... (13 Replies)
Discussion started by: Poonamol
13 Replies

7. Shell Programming and Scripting

Random word generation with AWK

Hi - I have a word GTTCAGAGTTCTACAGTCCGACGAT I need to extract all the possible "chunks" of 7 or above letter "words" from this. SO, my out put should be GTTCAGA TTCAGAG TCAGAGT CAGAGTTCT TCCGACGAT CAGTCCGACG etc. How can I do that with awk or any other language? I have no... (2 Replies)
Discussion started by: polsum
2 Replies

8. Shell Programming and Scripting

Exclude specific word from input file problem asking...

Hi, Below is my input file and desired output file: Input file: >header_N_1 ASFDGDGNDGEGWETWRYWTETWNETOWETWETWNETTETNWET . . Desired output file: >header_N_1 ASFDGDGDGEGWETWRYWTETWETOWETWETWETTETWET . . From the input file, I just hope to exclude the 'N' word from its content... (5 Replies)
Discussion started by: patrick87
5 Replies

9. Shell Programming and Scripting

Random word from a flat text file

Hello, I need to take a random word from a flat text file with words in it seperated by spaces. The code I am using, always gives me the first word. Can anyone please shed some light on this. Here's my code. Thanks echo table roof ceiling jar computer monitor keyboard carpet >... (5 Replies)
Discussion started by: Freakhan
5 Replies

10. UNIX for Dummies Questions & Answers

how tp del progs

ermm... wats the general commands to uninstall programs.....izzit rpm -e cos it keep telling me package not installed..... anyway anyone know any good links for licq for redhat 9.0 shrike ... cos downloaded one ... dun seems to be working ... trying to get rid of it appreciate if anyone can... (3 Replies)
Discussion started by: kaya
3 Replies
Login or Register to Ask a Question