Search Results

Search: Posts Made By: Mid Ocean
1,036
Posted By Mid Ocean
Curl detection of redirect
This URL:

Internet Archive Wayback Machine (https://web.archive.org/web/20141129025534/http://rapor.tuik.gov.nksdb2'rts/rwservlet?ad)

..will redirect to this URL when using a browser:
...
2,181
Posted By Mid Ocean
Everything is working now as mentioned earlier....
Everything is working now as mentioned earlier. If you are interested in the full application it is here:
...
2,181
Posted By Mid Ocean
Ok that's good to know that it is hard to...
Ok that's good to know that it is hard to impossible because I have struggled with how to do it. Your method is workable.

On non-greedy and gawk found this:
...
2,181
Posted By Mid Ocean
I initially tried that solution (using split,...
I initially tried that solution (using split, same idea) and it gives incorrect results.

Can't post the full data on unix.com, but the full source for a Wikipedia article on Pastebin:
...
2,181
Posted By Mid Ocean
awk and regex of wikisource data
This is for GNU Awk.

A sample file.txt contains this data (actual text from Wikipedia):


In June 2000, ''Bookface, Inc.'' launched the website www.Bookface.com (http://www.Bookface.com), a...
1,183
Posted By Mid Ocean
Thank you, Don. That is much better. I did not...
Thank you, Don. That is much better. I did not realize A-z was catching the square brackets which appears to be the underlying problem.

Scrutinizer, it's part of a larger Awk script which passes...
1,183
Posted By Mid Ocean
OK - I found the problem. The match line should...
OK - I found the problem. The match line should look like this:

match(article,/\yCategory:[[:space:].A-z0-9]*deaths\y/,a)

The problem was [: punct:] was matching the [[]] characters in file.txt...
1,183
Posted By Mid Ocean
Gawk and regexp
Hello,

This is a problem I've worked on a while and can't figure out.

There is a file.txt


..some stuff..
[[Category:98 births]]
[[Category:2nd C. deaths]]
..some stuff..
The Awk...
5,988
Posted By Mid Ocean
Hi thanks. This is great: awk -v na="Matthew...
Hi thanks. This is great:
awk -v na="Matthew Lewis (writer)" 'BEGIN{gsub(/\(|\)/,"\\\\&", na)} $0 ~ na' file.txt

It is actually four \\\\& not three \\\& .. but now it works. Thanks!
5,988
Posted By Mid Ocean
awk match shell variable that contains special characters?
How to match a shell variable that contains parenthesis (and other special characters like "!")

file.txt contains:

Charles Dickens
Matthew Lewis (writer)


name="Matthew Lewis...
1,289
Posted By Mid Ocean
Ahh "$0=var" is what's missing. Duh. Thank...
Ahh "$0=var" is what's missing. Duh. Thank you!
1,289
Posted By Mid Ocean
awk processing of passed variables
Currently have this:


set current=192.168.0.5
set servicehost = `echo $current | awk -F. '{print $4}'`
echo $numberoffields
5

..but would like to reduce # of variables and eliminate echo to...
Showing results 1 to 12 of 12

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