-2

I have a large file with over 800k entries (access log file). I need to output a file with only clean URLs (without parameters / "?") in the URL.

Output should only display entries that DON'T have a "?" in the URL.

Parameter url:

http://www.example.com/sample?parameter=1

2 Answers2

4

In POSIX grep with the flag -v for inverse match,

grep -v "?" file

Or using awk with !

awk '!/?/' file

Using GNU sed

sed -n '/?/!p' file
Inian
  • 71,145
  • 9
  • 121
  • 139
3

@Seasonal_showers: You haven't shown us a handful samples, so considering that your Input_file will have only URLs and nothing else, could you please try following then.

grep -v '?' Input_file

Let me know if this is not helping, you could show more sample Input_file details for better understanding then.

RavinderSingh13
  • 117,272
  • 11
  • 49
  • 86