10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
In a file we have the following data like as below
abcdef="cfg-1-15"
bmmdda-g-45-2
yhdiao"rtg-1-df-34"
I need a sed/awk command to replace the above string with empty.
Thx, (1 Reply)
Discussion started by: kirankumar
1 Replies
2. Shell Programming and Scripting
Hi,
i need a single command to create multiple empty files(no trailing lines as well) and empty the files if already existing.
please let me know or if this has been ansered, if some ocan share the link please, thanks
> newfile.txt
or
:> newfile.txt
do not work (4 Replies)
Discussion started by: Onkar Banerjee
4 Replies
3. Shell Programming and Scripting
Dear community,
I have two output files that contains some CR
# cat first.out
1234567890 598679857648566 9
1234567234 365837465873465 4
2342343243 289374982374894 4
# cat second.out
2342342342 ... (2 Replies)
Discussion started by: Lord Spectre
2 Replies
4. Shell Programming and Scripting
Hi
What I'm trying to do is delete every blank line upto a certain number, so for instance I only want to delete the first 4 empty lines within a file, I know how to delete every line with:
sed '/^$/d'
But I can't figure out how to limit it to only the first 4 occourances
I though it... (5 Replies)
Discussion started by: duonut
5 Replies
5. Shell Programming and Scripting
is there a way with sed to removed more than one set of lines in one line?
so i mean
sed ${firstElem},${lastIndex}d web.xml > web1.xml
this will delete lines between ${firstElem},${lastIndex}
i want in the same line to do somethinkg like this (doesn't work so far)
sed... (3 Replies)
Discussion started by: Poki
3 Replies
6. Shell Programming and Scripting
Input:
hello hello
hello hello
monkey
donkey
hello hello
drink
dance
drink
Output should be:
hello hello
monkey
donkey
drink
dance (9 Replies)
Discussion started by: cola
9 Replies
7. Shell Programming and Scripting
Hello:
I searched here for "vi -c" but found no hits.
How can I use vi -c to remove ALL empty lines, regardless of how many?
I tried
<code>
vi -c ":g/^$/d | wq" filename
</code>
but I have to run it several times.
This is NOT homework. :)
Thanks for your time. (3 Replies)
Discussion started by: Habitual
3 Replies
8. Shell Programming and Scripting
Hi Everyone,
# cat 1
a
b b
cc
1
2
3 3 3
4
55 5
a
b (2 Replies)
Discussion started by: jimmy_y
2 Replies
9. Shell Programming and Scripting
Can somebody explain why my sed command is not working.
I do the folloinwg:
Generates a binary file to /tmp/x1.out
/usr/lib/sa/sa2 -s 4:00 -e 8:00 -i 3600 -A -o /tmp/x1.out
decodes the file (no problem so far)
sar -f /tmp/x1.out
When I do this it does not appear to delete the... (4 Replies)
Discussion started by: BeefStu
4 Replies
10. Shell Programming and Scripting
I was just looking at this post: https://www.unix.com/shell-programming-scripting/22893-delete-multiple-empty-lines.html.
and I am looking to achieve the same with sed. So the idea is to delete lines from a file where a certain field has no value.
Inputfile:
EMID MMDDYY HOURS JOB EMNAME
0241... (4 Replies)
Discussion started by: figaro
4 Replies