Search Results

Search: Posts Made By: p1ne
1,294
Posted By RudiC
How far would awk '$1=$1' RS= ORS="\n\n" fileget...
How far would awk '$1=$1' RS= ORS="\n\n" fileget you?
5,671
Posted By Corona688
That's the clue we needed - the reason it doesn't...
That's the clue we needed - the reason it doesn't work when you put the same command in a pipe chain.

It doesn't work simply because wget refuses to output to anything but a regular file. Pipes,...
5,671
Posted By Corona688
That's not how fifo's work. mkfifo...
That's not how fifo's work.

mkfifo /tmp/jobqueue

# Need to put this in the background, since it will wait until both
# ends of the fifo are open
( wget -q -r -l1 -O /tmp/jobqueue URL/ & )
...
5,671
Posted By RudiC
Would using a fifo (as a regular file for -O) be...
Would using a fifo (as a regular file for -O) be an option?
5,671
Posted By Don Cragun
According to the wget man page...
According to the wget man page (https://www.unix.com/man-page/linux/1/wget/), old versions (before version 1.11) and new versions of wget (version 1.11.2 and later, although it may issue a warning in...
1,724
Posted By Don Cragun
The pipe symbols in the extended regular...
The pipe symbols in the extended regular expressions used in awk (and grep -E and some other utilities) separate alternatives. They don't have to be complete words. The line of code I suggested:...
1,724
Posted By Don Cragun
No. In awk /^["hour"]/ will select any line...
No. In awk /^["hour"]/ will select any line starting with ", starting with h, starting with o, starting with u, or starting with r. What you want is something considerably more complex like:...
1,724
Posted By RavinderSingh13
Hello p1ne, rdrtx1's solution could be...
Hello p1ne,

rdrtx1's solution could be little modified(where removing the string concatination to line and directly printing it rather) to as follows may help you in same too.

awk '
/^[pfcdl]/...
1,724
Posted By RudiC
You need to make sure that once a modification is...
You need to make sure that once a modification is done, it won't be subject to another one (e.g. by adapting the sequence of modifications). Try
sed 's/^[aeiou]/an &/; s/^[bghqrtwz]/a &/;...
1,724
Posted By rdrtx1
awk ' /^[pfcdl]/ {$0="your " $0; print ; next} ...
awk '
/^[pfcdl]/ {$0="your " $0; print ; next}
/^[vjkmns]/ {$0="the " $0; print ; next}
/^[bghqrtwz]/ {$0="a " $0; print ; next}
/^[aeiou]/ {$0="an " $0; print ; next}
1' list.txt
5,391
Posted By RudiC
Can't test right now, but would this do:sed -n...
Can't test right now, but would this do:sed -n '/<th><a href/{s/^.*<th>//;s/<\/th>.*$//;s/<[^>]*>//gp}' file
5,391
Posted By RavinderSingh13
Glad to help you p1ne. Could you please try...
Glad to help you p1ne. Could you please try following code and let us know if this helps.

sed -n '/^<th><a href="/s/\(.*">\)\(.*\)\(<\/a.*\)/\2/p' Input_file
Output will be as follows.

Ford...
5,391
Posted By RavinderSingh13
Hello p1ne, Could you please try following...
Hello p1ne,

Could you please try following and let me know if this helps you.

awk '($1 ~ /<th><a/){sub(/.*\">/,X,$0);sub(/<.*/,X,$0);print $0}' Input_file
Output will be as follows.

Ford...
5,391
Posted By RudiC
Given those <th> tags are on a line by themselves...
Given those <th> tags are on a line by themselves (which would be required for your awk sample to work anyway),

sed -n '/^<th/s/<[^>]*>//gp' file
Buick LeSabre


EDIT: Should that NOT be the...
1,198
Posted By RavinderSingh13
Hello p1ne, Following explanation could help...
Hello p1ne,

Following explanation could help you in same.

#!/bin/awk -f
BEGIN{ #### Starting BEGIN section of awk here.
for(i=0;i<=10;i++) #### starting a for loop...
1,762
Posted By RudiC
The for construct is used to iterate through a...
The for construct is used to iterate through a list or repeatedly evaluate an expression. Using it for one single value is at least, hmmm, questionable, as the loop variable is set to exactly that...
2,546
Posted By Don Cragun
Yes, split($0, %, ".") creates an array named T...
Yes, split($0, %, ".") creates an array named T with each element of T[] containing the text between periods in the input line. If you'd like to get rid of leading whitespace characters at the start...
2,546
Posted By RudiC
Given that the input is one single line of text,...
Given that the input is one single line of text, try
awk '
{N = split ($0, T, ".")
CNT = 1
while (CNT <= N) {RND = int(5*(1+rand()))
...
Showing results 1 to 18 of 18

 
All times are GMT -4. The time now is 11:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy