Quote:
Originally Posted by
Don Cragun
I don't understand.
Why is your output field separator sometimes a comma and sometimes a space and a comma? Why aren't all of the spaces removed from the output?
There is no "Pippo.com - 404 File Not Found" in your input file (in field 7 nor anywhere else). Are you just saying that you want to remove the last slash character (/) and everything that following from field 7?
Furthermore, your sample code removes the period and everything following it from the 1st field; but your desired output shows no change at all to field 1 AND your description of your problem says nothing about changing field 1.
Please be more clear in your explanation of what you are trying to do.
Sorry, will try to explain it better.
1. what i have is a common squid log forrmat.
2. what i need is to load in a database this log file.
What is my flow:
1. convert log file separated by space in a CSV file.
2. trim the destination url field cause i'm not intersted in full url but only in destination, so http://www.blablabla.com/bla.html have to be transformed in
www.blablabla.com.
(btw, sorry i forget to uncheck "Automatically parse links in text")
What i say is that for me is simple create a CSV file, and with the shell code trim the file but shell code is very very slow. What i need is understand how to make a sed/awk script that will "clean" only the filed 7 (url)
Thank in advance and sorry for the poor and confudes information in first post.