10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have kind of a strange one here. I have a file of consecutive /24 ip blocks. If there are 8 consecutive ip blocks which represent a /20 then I need to print the first line. I played around and did not get the results I need, especially when considering that the highest $3 will be is 255 and then... (6 Replies)
Discussion started by: numele
6 Replies
2. Shell Programming and Scripting
Running below line gives 3957 as length of longest line in file 20121119_SRMNotes_init.dat
awk ' { if ( length > 3950 ) { x = length } }END{ print x }' 20121119_SRMNotes_init.dat
While wc -L 20121119_SRMNotes_init.dat gives output as 4329. Why is there a difference between these two commands.... (2 Replies)
Discussion started by: Satish Mantha
2 Replies
3. Shell Programming and Scripting
I want to import a textfile with getline into var t which has several lines. How do import all lines, since it only imports the last line:
while < ((getline t "textfile") > 0) (7 Replies)
Discussion started by: sdf
7 Replies
4. Shell Programming and Scripting
I would like to print the output beginning with a header from a seperate file like this:
awk 'BEGIN{FS="_";print ((getline < "header.txt")>0)} { if (! ($0 ~ /EL/ ) print }" input.txtWhat am i doing wrong? (4 Replies)
Discussion started by: sdf
4 Replies
5. Shell Programming and Scripting
Here is I want to do:
find lines in file filteredtrace.txt which is not continued as
a multiply of 4 and strip them from file original_trace_framno.
problem is awk used the ' symbol
so pipe of getline has to use the " symbol
while agument of sed has to use the " symbol,
it doesn't... (8 Replies)
Discussion started by: lzq420241
8 Replies
6. Shell Programming and Scripting
Hi!
I have an input file for an awk script that I need to split into several files and the process them separately line by line.
I have splitted the input file into the other files, that have been created correctly. But, since their names are parametric (i.e. output_1.txt, output_2.txt..... (2 Replies)
Discussion started by: Alice236
2 Replies
7. Shell Programming and Scripting
hi all,
i have a big problem and i don't know what to do. This is the thing: i have a flat file with 26 fields, which are separated by ';'
by example, i have this:
Peter;Smith;2005;200508; .........
if the lengths of the fields are:
field 1: Alphanumeric - field 2: Alphanumeric - field... (4 Replies)
Discussion started by: DebianJ
4 Replies
8. Solaris
I am used to using "set -o emacs" and then using "CNTL-P" for getting previous commands in solaris but on one host it does not work and instead just makes a DONG!!
# ksh
# set -o emacs
# ls
# ^p
Can anyone offer guidance as to why this is?
Thank you my friends.
akbar (0 Replies)
Discussion started by: akbar
0 Replies
9. Shell Programming and Scripting
My C++ program creates a nxn matrix with given value. For e.g if the input is 10 it will creates a matrix of 10x10 now what i want is the script should run program and give input values in a variation of 1000. Say first matrix of 1000 then 2000 , 3000 ..... 10000. I tried using for loop but unable... (2 Replies)
Discussion started by: tonyaim83
2 Replies
10. Shell Programming and Scripting
Hello,
I am trying to use the awk getline command to populate an array from a flat file.
Has anyone done this before?
So we have file1:
a
b
c
d
I want to create an array like index that contains these four elements (8 Replies)
Discussion started by: penfold
8 Replies