10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hi,
A beginner one.
my input.tab (tab-separated):
h1 h2 h3 h4 h5
item1 grpA 2 3 customer1
item2 grpB 4 6 customer1
item3 grpA 5 9 customer1
item4 grpA 0 0 customer2
item5 grpA 9 1 customer2
objective:
output a file for each customer ($5) with the item number ($1) only if $2 matches... (2 Replies)
Discussion started by: beca123456
2 Replies
2. Shell Programming and Scripting
I have been searching and trying to come up with an awk that will perform the following on a
converted text file (original is a pdf).
1. Since the first two lines are (begin with) text they are removed
2. if $1 is a number then all text is merged (combined) into one line until the next... (3 Replies)
Discussion started by: cmccabe
3 Replies
3. Shell Programming and Scripting
Hi all,
I am trying to delete all lines from a file in which the value in 'column 3' is not the value of 'column 1' + 4. The code below that I tried doesn't work.
awk '$3 == $1 + 4 {print}' input > output
Example Input:-
1 xxx 2
3 xxx 26
4 xxx 8
2 xxx 9
7 xxx 11
(input file... (9 Replies)
Discussion started by: livbaddeley
9 Replies
4. Shell Programming and Scripting
I have two files, a keepout.txt and a database.csv. They're unsorted, but could be sorted.
keepout:
user1
buser3
anuser19
notheruser27
database:
user1,2343,"information about",field,blah,34
user2,4231,"mo info",etc,stuff,43
notheruser27,4344,"hiya",thing,more thing,423... (4 Replies)
Discussion started by: esoffron
4 Replies
5. Shell Programming and Scripting
Hi,
I have a file with contents.
file1:
<2013 tttaaa
abc123
<2013 gggdddd
<2013 sssssss
<2013 eeeee
I need to remove the lines which do not have the word "tttaaa"
can some one help ? (7 Replies)
Discussion started by: giri_luck
7 Replies
6. Shell Programming and Scripting
Hello again, I am wanting to remove all duplicate blocks of XML code in a file. This is an example:
input:
<string-array name="threeItems">
<item>item1</item>
<item>item2</item>
<item>item3</item>
</string-array>
<string-array name="twoItems">
<item>item1</item>
<item>item2</item>... (19 Replies)
Discussion started by: raidzero
19 Replies
7. Shell Programming and Scripting
Hi,
I came to know that using awk '!x++' removes the duplicate lines. Can anyone please explain the above syntax. I want to understand how the above awk syntax removes the duplicates.
Thanks in advance,
sudvishw :confused: (7 Replies)
Discussion started by: sudvishw
7 Replies
8. Shell Programming and Scripting
Hi guys,
I need to remove the pattern (ID=180), one line before and four lines after.
Thanks. (5 Replies)
Discussion started by: ashimada
5 Replies
9. Shell Programming and Scripting
I have two files and need to compare the two files and to remove the matching lines from both the files (4 Replies)
Discussion started by: shellscripter
4 Replies
10. Shell Programming and Scripting
hey guys, I have two files both with two columns, I have already created an
awk code to ignore certain lines (e.g lines that start with 963) as they wou
ld begin with a certain string, however, the rest I have added together and
calculated the average.
At the moment the code also displays... (3 Replies)
Discussion started by: chlfc
3 Replies