10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
I need one help to replace particular words in file based on if finds another words in that file .
i.e.
my self is peter@king.
i am staying at north sydney.
we all are peter@king.
How to replace peter to sham if it finds @king in any line of that file.
Please help me... (8 Replies)
Discussion started by: Rajib Podder
8 Replies
2. Shell Programming and Scripting
My file has the entries like below...
/dev/sds
/dev/sdak
/dev/sdbc
/dev/sdbu
I want to make the file like below
echo 1 > /sys/block/sds/device/rescan
echo 1 > /sys/block/sdak/device/rescan
echo 1 > /sys/block/sdbc/device/rescan
echo 1 > /sys/block/sdbu/device/rescan (2 Replies)
Discussion started by: saravanapandi
2 Replies
3. Shell Programming and Scripting
How could be removed \n only if appearing at position 80 in the line? (4 Replies)
Discussion started by: RomanF
4 Replies
4. Shell Programming and Scripting
I have file like below
Hi iam author <br>joseph</br> in france.
I live in my home <br></br> but no food.
I will play footbal <br></br> but i wont play cricket.
I will read all the books <br>all fiction stories</br> i hate horror stories.
I want output like below
Hi iam author... (3 Replies)
Discussion started by: vinothsekark
3 Replies
5. Shell Programming and Scripting
Hi, Unix gurus,
I have a requirement as following:
checking existing file, if the file only contain one line. then append "No data" else keep existing file as is.
can i achieve this by in command line without write a script.
:wall:
Thanks in advance. (4 Replies)
Discussion started by: ken002
4 Replies
6. Shell Programming and Scripting
i want to write a shell script that correct a text file.for example if i have the input file:
"john has has 2 apples
anne has 3 oranges oranges"
i want that the output file be like this:
"john has 2 apples
anne has 3 oranges"
i've tried to read line by line from input text file into array... (11 Replies)
Discussion started by: cocostaec
11 Replies
7. Shell Programming and Scripting
I have a file that needs to be cleaned up. Here is the file:
Project
Project John
Project Gary
Project Sean
Project2
Project2 Lisa
Project2 Tyler
Project2 Sam
Project3
Project3 Mike
Project3 Bran
I need the o/p to be:
Project
John
Gary
Sean
Project2 (7 Replies)
Discussion started by: leepet01
7 Replies
8. Shell Programming and Scripting
Hi All,
I have a text file with name of source files in that. source files ends with .mxml and .css. Now I want to remove the extensions of these source files.
Currently I can do so by writing 2 sed commands, as there are files with just 2 different extensions. But I want to do it in one sed... (6 Replies)
Discussion started by: mkashif
6 Replies
9. Shell Programming and Scripting
Hello all
i know it is pretty hard one but you will manage it all
after noticing and calculating i find a rhythm for the file i want to edit
to copy the last 12 characters in line but the problem is to add after first 25 characters in same line
in other way too copy the last 12 characters... (10 Replies)
Discussion started by: princesasa
10 Replies
10. Shell Programming and Scripting
I have the task of removing all uppercase words from csv files, mit
10000's lines. I think it shoud be possible with regex's, something
like "s/{2,}//g" but I can't get it work with sed or Vi. It would
also be possible to script in ksh, awk, perl or python.
example
this "this is a EXAMPLE... (5 Replies)
Discussion started by: frieling
5 Replies