10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
My Input File :
"MN.1.2.1.2.14.1.1" :=
"MN_13_TM_4" ( 000000110110100100110001111110110110101110101001100111110100011010110111001 )
"MOS.1.2.1.2.13.6.2" :=
"MOS_13_TM_4" ( 000000110110100100110001111110110110101110101001100111110100011010110111001 )
Like above template,I have... (4 Replies)
Discussion started by: Preeti Chandra
4 Replies
2. Shell Programming and Scripting
Pattern:
Mary walks at the park every day with her children
sed 's/$/ /'
will make it add 1 space at the end (trailing)
I want to add X ($VARIABLE) number of spaces (which comes from RANDOM)
i.e.
VARIABLE='14'
then it will do:
sed 's/$/ /'
= 14 spaces added at the... (10 Replies)
Discussion started by: holyearth
10 Replies
3. Shell Programming and Scripting
Sed replace using same pattern repeating multiple times in a line
I have text like below in a file:
I am trying to replace the above line to following
How can I acheive this?
I am able to do it if the occurrence is for 1 time:
But If I try like below
I am getting like this:
I have to... (4 Replies)
Discussion started by: sol_nov
4 Replies
4. Shell Programming and Scripting
Hello,
Is it possible to embed the command output to the replacement of sed? Say I need to replace all the blank lines with random strings:
input:
ACCTTCGTCTTCTGG
GCTTGAGATGGTCCA
GCAGGGCTAGTGACG
GACGAGTCTCTTGAC
ACCAAATCAAAGATCand output is:
>26aa36d934d44f06d15b3aab4645a602 $(date |... (9 Replies)
Discussion started by: yifangt
9 Replies
5. UNIX for Dummies Questions & Answers
Hello Is there a way to calculate how many times a particular symbol appeared in a string before a particular word.
Desktop/Myfiles/pet/dog/puppy
So, I want to count number of occurence of"/" in this directory before the word dog lets say.
Cheers,
Bob (3 Replies)
Discussion started by: FUTURE_EINSTEIN
3 Replies
6. Shell Programming and Scripting
Hi,
I am trying to get lines between the last occurrences of two patterns. I have files that have several occurrences of “Standard” and “Visual”. I will like to get the lines between “Standard” and “Visual” but I only want to retain only the last one e.g.
Standard
Some words
Some words
Some... (4 Replies)
Discussion started by: damanidada
4 Replies
7. Shell Programming and Scripting
Hello All,
I'm trying to write a script that will perform a dynamic match (of a dynamic variable) and set a variable to have the resulting (match) value.
The idea is that the environment variable to check ($1) and the regular expression to use ($2) are given as parameters.
For example,... (5 Replies)
Discussion started by: aedgar
5 Replies
8. Shell Programming and Scripting
I have a line that works for static filename
cat /directorypath/filename | sed '//d;//d' > filename
This approach when used in a script works well.
Then i need a list of filenames to give this line.
I can get the list into a file by filelist1='ls -m'
then use filelist2=${filelist1##ls... (4 Replies)
Discussion started by: ericonanson
4 Replies
9. Shell Programming and Scripting
I have string as and I want to print first two words as output. (3 Replies)
Discussion started by: Diggi
3 Replies
10. Shell Programming and Scripting
Hi all,
I have a data file formatted as in the following line:
Achadd 0:35 1:35 2:35 3:40 4:40 5:40
I need the minutes converted to seconds; I wrote a script, min2sec, to do so for one datapoint. I was hoping to use sed as in the following code to call this script and... (4 Replies)
Discussion started by: x-375HK-x
4 Replies