I have a log-file where at the end of a series of lines you can see if this block is relevant
now I'm looking for a command like sed to delete de blocks ending with "Content-Length: 0" and beginning with the last "--" before this line.
I tried sed -n "/--/,/Content-Length: 0/d" but this takes the first "--" and the first "Content-Length: 0" and deletes it.
ex :
line 1 "--"
line 2
line 3 "
I have a log-file where at the end of a series of lines you can see if this block is relevant
now I'm looking for a command like sed to delete de blocks ending with "Content-Length: 0" and beginning with the last "--" before this line.
I tried sed -n "/--/,/Content-Length: 0/d" but this takes the first "--" and the first "Content-Length: 0" and deletes it.
ex :
line 1 "--"
line 2
line 3 "
Hi,
I have a issue, I need to loop through a comma delimited file and check for the length which exceeds specified length , if Yes truncate the string.
But my problem is , I do not have to check for all the fields and the field lenght is not same for all the fields.
For ex:
Say my line
ahjdh,dfhkajhdf,adhklf,eiour
say I need to check length only for 2nd and 4th and max length for 2nd is 6
Another sniff:16:17:25.686360 ARP, Request who-has 192.168.1.1 tell 192.168.1.105, length 28
16:17:26.689702 ARP, Request who-has 192.168.1.1 tell 192.168.1.105, length 28
16:17:27.693010 ARP, Request who-has 192.168.1.1 tell 192.168.1.105, length 28
16:17:28.713027 ARP, Request who-has 192.168.1.1 tell 192.168.1.105, length 28
16:17:29.716363 ARP, Request who-has 192.168.1.1 tell 192.168.1.105, l
Hi,
I've tried searching through the forum but I've drawn a blank so i'm going to post here. I'm developing a number of checks on a CSV file, trying to find if any are greater than a max limit. I'm testing it by running it from a command line.
The file I'm testing has 8 records.
I want to make a script to read row by row and find its length. If the length is less than my required length then i hav to append spaces to that paritucular row.
Hello
I'm manipulating a file, taking certain variables & printing them to an output file using awk (actually nawk because I'm using -v).
I now want to take a field from the input file & expand it to a pre-defined length by preceding the string with spaces.
I am trying to trim spaces for the fixed width file starting from location 129 and of length 20.
I am expecting only around 40 records that will have length greater than 9. But i am getting around 4000 records.
Please help me correct the following.
Code:
nawk '{if (a=length(gsub(/ */,"",substr($0,129,20)))>9); print $a }' testfile |wc -l
Hi folks,
I am self-learning as I can
I have a script that has read a file into an array.
I can read out each line in the array with the code:
Code:
for INDEX in {0..$LENGTH} ## $LENGTH was determined at the read in
do
echo "${data[$INDEX]}"
done
What I need to do is test the first char of each line so I can branch out for processing.
In essence, the psudo-code look