awk help
Hi,
I am hoping someone can help - I don't know awk/sub so I'd like some help...with an explanation of how it works if possible.. I need to take the 8th column of a csv and replace any dots (".") with slashes ("/").... So I know I can use awk to parse the csv file and print the necessary column: Code:
awk -F "\"*,\"*" '{print $8}' thisfile.csv This will be scripted as well... I appreciate any and all help... Edit sample string : this, this, this, this, this , this , this , 27.11.2011, this, this, this I basically need the date in DD/MM/YYYY format |
so now I know the following is probably a fair bit easier:
Code:
awk -F "," '{print $8}' file.txt Code:
awk -F "," '{gsub(".","/" $8; print}' file.txt > outputfile.txt Further edit - I am getting closer I think - this removes all the commas in the file: Code:
awk -F "," '{gsub("[.]"."/" $8); print' file.txt |
Apologies I found the solution- it shows with enough googling you can find a solution:
Code:
awk -F "," '{$8==gsub("[.]","/"); print}' file.txt > output.txt |
All times are GMT -5. The time now is 07:34 PM. |