Home Man
Search
Today's Posts
Register

If you're not sure where to post a Unix or Linux question, post it here. All unix and Linux beginners welcome in this forum!

Wildcards when using awk -F

Tags
vgersh99

Login to Reply

 
Thread Tools Search this Thread
# 1  
Old 10-17-2017
Wildcards when using awk -F

Trying to filter information when using awk -F. I'm trying to use wildcards to match a range of values but can't get the syntax to work.

Since I'm using awk -F I'm setting my delimiter then entering specific information abcde but if I want to do abcd(e-9) how do I make that work? Do I place the escape character in the quotes?

Any help is appreciated

Last edited by rbatte1; 10-17-2017 at 07:20 AM.. Reason: Added ICODE tags for clarity
# 2  
Old 10-17-2017
Welcome fgarvis88,

I have a few to questions pose in response first:-
  • What have you tried so far?
  • What output/errors do you get?
  • What OS and version are you using?
Most importantly, What have you tried so far?



We're all here to learn and getting the relevant information will help us all.

Kind regards,
Robin
The Following User Says Thank You to rbatte1 For This Useful Post:
# 3  
Old 10-17-2017
I have tried using abcd..., abcd...*, ^abcd, /abcd...\, abcd/e-9\ basically just different combinations to get it to filter what I want but to no avail.

When I don't use proper syntax I either get an error message with a "^" pointing to the place where the syntax goes wrong or it just hangs up and sits there in a loop and I escape out of it to try again.

I'm fairly new to this and regex/syntax aren't my strongest suit.

Using 14.04.01 Ubuntu

---------- Post updated at 06:43 AM ---------- Previous update was at 06:33 AM ----------

Also if you want to message me I'm open to that. I can't send messages since I'm such a noob :)

---------- Post updated at 06:47 AM ---------- Previous update was at 06:43 AM ----------

I also thought it may be easier to set a variable for what I'm looking for and stick it in there. I haven't set variables using awk before but that might be the more efficient way to go.

Last edited by rbatte1; 10-17-2017 at 09:11 AM.. Reason: Added ICODE tags
# 4  
Old 10-17-2017
-F is for specifying field separators. It's not intended to match strings. That's something you would do in the awk itself. -F can be ranges (of characters), for example -F "[a-e0-9]" would identify any character a through e, and 0 through 9 in the input as a field separators. But I doubt that's what you really want to do.

What exactly are you trying to do (without trying to tell us how you're doing it, because I think that's confusing us, well me anyway!)? It would help if you gave, also, a sample of the input file you using.
The Following User Says Thank You to Scott For This Useful Post:
# 5  
Old 10-17-2017
Right, I'm using -F so I can filter on particular fields. This is a SecOnion VM so I'm trying to use some sort of wildcard combo to filter certain octets of an IP address of web traffic.

For instance I'm looking at http traffic but I want to see 5 or 6 fields so I can focus on who is talking to who. I want to filter out a range of IP's that take up a bulk of the traffic so I can focus on the onesies and twosies easier.

Last edited by rbatte1; 10-17-2017 at 09:12 AM.. Reason: Added ICODE tags
# 6  
Old 10-17-2017
Please become accustomed to provide decent context info of your problem.

It is always helpful to carefully and detailedly phrase a request, and to support it with system info like OS and shell, related environment (variables, options), preferred tools, adequate (representative) sample input and desired output data and the logics connecting the two including your own attempts at a solution, and, if existent, system (error) messages verbatim, to avoid ambiguities and keep people from guessing.
The Following User Says Thank You to RudiC For This Useful Post:
Login to Reply

« Previous Thread | Next Thread »
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Using Wildcards in scp phpsnook Shell Programming and Scripting 0 10-10-2011 03:43 AM
For loop with wildcards nim UNIX for Dummies Questions & Answers 2 10-09-2011 02:09 PM
Wildcards cokedude UNIX for Advanced & Expert Users 1 10-24-2010 04:07 AM
SED and wildcards Xterra UNIX for Dummies Questions & Answers 10 09-11-2010 04:26 PM
wildcards in path glev2005 UNIX for Dummies Questions & Answers 5 09-19-2009 01:42 PM
wildcards NOT C3000 UNIX for Dummies Questions & Answers 5 11-21-2007 06:19 AM
Wildcards in SED HealthyGuy Shell Programming and Scripting 5 09-27-2006 07:32 PM
ls with wildcards benu302000 UNIX for Dummies Questions & Answers 10 06-29-2005 01:53 PM
wildcards benu302000 UNIX for Dummies Questions & Answers 3 06-29-2005 12:10 PM
Wildcards in VI peter.herlihy UNIX for Dummies Questions & Answers 8 01-08-2002 03:27 AM


All times are GMT -4. The time now is 01:17 AM.

Unix & Linux Forums Content Copyrightę1993-2018. All Rights Reserved.
UNIX.COM Login
Username:
Password:  
Show Password