10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have an input file that looks something like this:
....
key1: ABC
....
key2: DEF
....
key1: GGG
....
key2: HHH
....
The row of dots represents any number of lines that don't contain the strings "key1:" or "key2:" The strings key1: and key2: will always appear alternately as in the... (8 Replies)
Discussion started by: pmennen
8 Replies
2. Shell Programming and Scripting
Hi
I am working with sed to get string replace and print all the lines.
Cat f1
<text1>
tag123 44412c232place1
text456-text=
tag12 44412c232place4
jjaa
TAG456 44412c232place1066dfdf
erer
..
i have used this command -
sed -n '/tag/ s#place#SomePlace#gp' f1
It gives me... (2 Replies)
Discussion started by: krsnadasa
2 Replies
3. UNIX for Dummies Questions & Answers
Hi,
i have data file like:
START1
a
b
STOP
c
d
START2
e
STOP
f
START3
g
STOP
When one of the START<count> variable is passed, i should print all lines matching this until the first 'STOP'
for example if 'START2' is provided for match, i should get the result as:
START2 (1 Reply)
Discussion started by: ysrini
1 Replies
4. Shell Programming and Scripting
Dear all,
How can I print results (and of course, send this result to the text file) of sed command.
I mean, I want to know which lines of which files sed command has found.
For e.g, the result text file should contains:
file1.c:line 12
file2.h:line 14
file2.h:line 37
Please help me (10 Replies)
Discussion started by: Hannibal2010
10 Replies
5. Shell Programming and Scripting
Hi
Imagine that I have a text file containing the following student's data:
student: john
group: A
sex: male
age: 25
student: alice
sex: female
age: 20
group: B
It is guarantee the details will start by "student:", and then followed by the sex, age and group in any order.
Is it... (2 Replies)
Discussion started by: hezjing
2 Replies
6. UNIX for Dummies Questions & Answers
Hello,
ı want to started shell programing. But first, I want to learn ssh code. How can I use this codes ( sed - awk - print ). How do codes work?
Thanks..
Best Wishes.. (1 Reply)
Discussion started by: Nullsix
1 Replies
7. Shell Programming and Scripting
guys...
i'm currently trying to parse some html code:
<tr class="first" name="bc_10934363" class=""><td class="col1"><div class="ctitle">Some text</div><div class="crec" name="pc_10934363"></div><div class="ctext">Some text</div></td><td class="col2"><div class="ctext">SF zwei</div></td><td... (6 Replies)
Discussion started by: domi55
6 Replies
8. Shell Programming and Scripting
I have file.txt
bob
jon
jones
gary
I want to print from the botton, up using sed.
gary
jones
jon
bob
Whats one command I can use to do this? Or will I have to construct a new file that would hold the original file in reverse and then print the reversed file? (3 Replies)
Discussion started by: Bandit390
3 Replies
9. UNIX for Dummies Questions & Answers
Hi,
I remembered that I used the ruler command at the unix prompt.
But I tried to use it again and it says that command not found.
I don't know what had happened.
It's in the command not in VI, right?
Thanks! (1 Reply)
Discussion started by: whatisthis
1 Replies
10. Shell Programming and Scripting
Hi
It is possible with sed to print a pattern within a line matching regexp?
So, the line looks like : 19:00:00 blablablabla jobid 2345 <2>
the regexp is "jobid 2345" and the pattern is 56434.
That the code for find... (2 Replies)
Discussion started by: nymus7
2 Replies