10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi Guys ,
I have two files say a1 and a2 having following contents
a1
dag
wfd
a2
dag
wfd
chire
hcm
I want to delete only the lines in a2 which are in a1 and final output of a2 should be
a2
chire
hcm (6 Replies)
Discussion started by: Pradeep_1990
6 Replies
2. Shell Programming and Scripting
two files: one with the line number only, and the 2nd one with line number and content, as following:
line_file.txt
1
3
5
9
23
30
content_file.txt
1|we are the world|good|great
2|easily do this by highlighting you|easily do this by highlighting you|easily do this by highlighting... (2 Replies)
Discussion started by: dtdt
2 Replies
3. Shell Programming and Scripting
Ultimate goal is to delete lines from before and after a block of lines in a given file. First attempt was something like this:
sed -e '1,/STARTUP/ d' inputfile.txt > outputfile.txt
but that deleted everything down to and including the line with STARTUP. I need to delete everything before... (6 Replies)
Discussion started by: edstevens
6 Replies
4. Shell Programming and Scripting
Hello,
I have a file, which looks like:
I want to print the row containg "PRO" in second column after comparing and finding the minimum value of fifth column present in all "PRO". and likewise for every other string present in second column.
I am using :
filename=list... (2 Replies)
Discussion started by: CAch
2 Replies
5. Shell Programming and Scripting
HI,
I need one help to generate the file based on few condition,
I need to print only those line which has N and delete the line which as all Y's. ANd I need to compare only the fields which are marked as Y and N .
And one more thing is in the below file 1 and file 2 and file2 abc, dbc can... (6 Replies)
Discussion started by: rashmisb
6 Replies
6. Shell Programming and Scripting
I want to delete a line between selected lines using sed:
e.g. : Between "bus" to "pins", delete lines conaining "signal" word.
Input :
bus
direction
signal new
signal old
pins
signal ok
end
Desired Output:
bus
direction
pins
signal
end (4 Replies)
Discussion started by: nehashine
4 Replies
7. Shell Programming and Scripting
awk '!(/^$/||/--/||/selected/||/^ *$/){print "A." $1 " <> B." $1 " or"}' infile
my AWK out put is :
A.KZ <> B.KZ or
A.KZT <> B.KZT or
A.KZ_Z <> B.KZ_Z or
A.LH <> B.LH or
A.MAN<> B.MAN or
A.OBJEKT <> B.OBJECT or
A.PAK <> B.PAK ;
is there any way to controle AWK to not print the... (1 Reply)
Discussion started by: kanakaraju
1 Replies
8. Shell Programming and Scripting
I am trying to print 1st, 2nd, 13th and 14th fields of a file of line numbers from 29 to 10029. I dont know how to put this in one code. Currently I am removing the selected lines by
awk 'NR==29,NR==10029' File1 > File2
and then doing
awk '{print $1, $2, $13, $14}' File2 > File3
Can... (3 Replies)
Discussion started by: ananyob
3 Replies
9. Shell Programming and Scripting
I have an if statement where I state that if there are more than one records (lines) found containing a string in a file, then it enters into a while loop to use each line for as many lines as there are and then stop.
Trouble is, I can't figure out how to move to the next instance of each line. ... (2 Replies)
Discussion started by: derekphl
2 Replies
10. Shell Programming and Scripting
Hi everybody:
I try to print in new file selected lines from another file wich depends on the first column.
I have done a script like this:
lines=( "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "21" "31" "41" "51" "55" "57" "58" )
${lines}
for lines in ${lines}
do
awk -v ... (6 Replies)
Discussion started by: tonet
6 Replies