Sed command filtering extra text/removing

Jay
"GET /?add=jt1777,justine,tignor,f,November_24_1983,Skeleton_,Italy HTTP/1.1" 200 34053 

does anyone know how to use the sed command to cut out the extra lines or filtering like

"GET /?=jt1777,f,November_24_1983,Skeleton_,Italy HTTP/1.1" 200 34053"

but include just only the name "justine, tigor". Thats all I need, just the first and last name.

Any ideas???

tachomi

You can use awk

echo "\"GET /?add=jt1777,justine,tignor,f,November_24_1983,Skeleton_,Italy HTTP/1.1\" 200 34053" | awk -F, '{print $2","$3}' 

Explanation:

  • -F, Here you're delimiting text with ,

  • '{print $2","$3}' You'll print the field 2 and 3 within the delimiter ,. If you want to print the comma, since this is being used as delimiter, it won't print so you must hardcode it ","

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

sed error complaining "extra characters after command"

From Dev

sed on mac: 'extra characters after p command'

From Dev

sed extra characters at end of l command

From Dev

BSD sed: extra characters at the end of d command

From Dev

Why is an extra space getting removed in sed substitution command

From Dev

sed: -e expression #1, char 10: extra characters after command

From Java

How to fix sed command on MacOS with error extra characters after \ at the end of c command?

From Dev

why "extra characters after command" error shown for the sed command line shown?

From Dev

Filtering a line with sed

From Dev

Filtering input with sed (regex)

From Dev

Filtering a line with sed

From Dev

Sed - How do I remove the extra characters that show up after running the command?

From Dev

sed command inside sed

From Dev

( sed command)-> sed $foo

From Dev

Filtering top command output

From Dev

Filtering a result from a command

From Dev

Cisco Show command filtering

From Dev

Filtering with Linux command line

From Dev

Sed matches unwanted extra characters

From Dev

npm install + extra command

From Dev

Extra parentheses in command substitution

From Dev

Laravel : Passing extra parameter on Collection filtering

From Dev

Adding extra content to Class Based View and filtering it

From Dev

Filtering the output from the ping command

From Dev

Filtering content of variable with uniq command

From Dev

Complex sed Command for Insert Command

From Dev

sed command : unterminated `s' command

From Dev

Sed Pattern filtering long html doc

From Dev

Command grouping in sed