Article 57QSE Grep not working for string with both spaces and numbers

Grep not working for string with both spaces and numbers

by
wackysiy1024
from LinuxQuestions.org on (#57QSE)
Hi

I am trying to print all the following entries from my input file.

Quote:
pptstatistics#rtpRequestCount#path 0#rate
pptstatistics#rtpRequestCount#path 1#rate
pptstatistics#rtpRequestCount#path 3#rate
pptstatistics#rtpRequestCount#path 2#rate
Since my string had a space,I wrote the grep in following format Quote:
grep "pptstatistics#rtpRequestCount#path *#rate " inputfile > output file
I wanted to get all the paths printed(in this case path 0-path 3)It didnt work. I also tried for another example string where i am trying to print the required strings with all paths and different cores. (essentially I am trying to print all with all different datapath and all values of icore

Expected output:
Quote:
datapath icore all parameter ocr-frames#datapath:0#icore:2
datapath icore all parameter ocr-frames#datapath:3#icore:5
datapath icore all parameter ocr-frames#datapath:5#icore:2

grep "datapath icore all parameter ocr-frames#datapath:*#icore:*" inputfile > output file
Any awk or sed commands to do this?latest?d=yIl2AUoC8zA latest?i=kkNXMzGYr2w:Ms2TiOjOZBc:F7zBnMy latest?i=kkNXMzGYr2w:Ms2TiOjOZBc:V_sGLiP latest?d=qj6IDK7rITs latest?i=kkNXMzGYr2w:Ms2TiOjOZBc:gIN9vFwkkNXMzGYr2w
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments