10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Greetings All,
I would like to find all occurences of a pattern and delete a substring from the all matching lines EXCEPT the first. For example:
1234::group:user1,user2,user3,blah1,blah2,blah3
2222::othergroup:user9,user8
4444::othergroup2:user3,blah,blah,user1
1234::group3:user5,user1
... (11 Replies)
Discussion started by: jacksolm
11 Replies
2. 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
3. Shell Programming and Scripting
hi to all
Does anyone know if there's a way to remove duplicate lines which we consider the same only if they have the first and the second column the same?
For example I have :
us2333 bbb 5
us2333 bbb 3
us2333 bbb 2
and I want to get
us2333 bbb 10
The thing is I cannot... (2 Replies)
Discussion started by: vlm
2 Replies
4. Shell Programming and Scripting
Hi,
my xml files looks something like this
<Instance Name="New York">
<Description></Description>
<Instance Name="A">
<Description></Description>
<PropertyValue Key="false" Name="Building A" />
</Instance>
<Instance Name="B">
... (4 Replies)
Discussion started by: tententen
4 Replies
5. 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
6. Shell Programming and Scripting
3
10 20
10 100
100 10000
Output:
3
10 20
10 100
100 10000
---------- Post updated at 07:59 AM ---------- Previous update was at 07:56 AM ----------
sed '/^$/d' file doesn't work. (8 Replies)
Discussion started by: cola
8 Replies
7. Shell Programming and Scripting
Hi,
I need to remove some lines from an XML file is the value within a tag is empty.
Imagine this scenario,
<acd><acdID>2</acdID><logon></logon></acd>
<acd><acdID></acdID><logon></logon></acd>
<acd><acdID></acdID><logon></logon></acd>
<acd><acdID></acdID><logon></logon></acd>
I... (3 Replies)
Discussion started by: giles.cardew
3 Replies
8. 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
9. 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
10. Shell Programming and Scripting
Hi
I have a file which looks like this
name: Sally group: Group4
name: Tim group: Group1
name: Dan group: Group2
name: Chris group: Group3
name: Peter group:
name: Fred group:
name: Mary group: Group2
Well I want to get rid of the... (4 Replies)
Discussion started by: bombcan
4 Replies