i want to loop in file to read line by line and in same line seperate the comma, with awk for example
i have file called gpc.csv which contain comma separated value , I want to read leach line and separate feild 3 and 4
gpc.csv file
###########
Production,Run PoverA script for Owner,pbst_o1,/appl/pbst/pbst_o1/bin/povera_bst.ksh,20
Production,Run PoverA script for Batch,pbst_b1,/appl/pbst/pbst_o1/bin/povera_bst.ksh,30
Acceptance,Backup .passfile file,abst_o,cp /appl/abst/abst_o1/etc/bst/.passfile /tmp,5
Acceptance,Clearing BATCH files from var/log and var/tmp folder, abst_b, "rm -rf /appl/abst/abst_o1/var/log/* /appl/abst/abst_o1/var/tmp/*;\
find /appl/abst/abst_o1/var/log/ -user abst_b1 -type f -exec rm {} ;\
find /appl/abst/abst_o1/var/log/ -user abst_b1 -type l -exec rm {} ;\
find /appl/abst/abst_o1/var/tmp/ -user abst_b1 -type f -exec rm {} ;\
find /appl/abst/abst_o1/var/tmp/ -user abst_b1 -type l -exec rm {} ;\
find /appl/abst/abst_o1/var/log/ ! -name log -user abst_b1 -type d -exec rmdir {} ;\
find /appl/abst/abst_o1/var/tmp/ ! -name tmp -user abst_b1 -type d -exec rmdir {} \,5"
Acceptance,Clearing OWNER files from var/log and var/tmp folder,abst_o,"find /appl/abst/abst_o1/var/log/ -user abst_o1 -t\ype f -exec rm {} \;\
find /appl/abst/abst_o1/var/tmp/ -user abst_o1 -type f -exec rm {} \;
find /appl/abst/abst_o1/var/log/ ! -name log -user abst_o1 -type d -exec rmdir {} \;
find /appl/abst/abst_o1/var/tmp/ ! -name tmp -user abst_o1 -type d -exec rmdir {} \;
ls -1a /appl/abst/abst_o1| grep -Evw "".|..|var|.ssh"" | xargs -I {} rm -rf {},5"
Acceptance,Creating tmp folder,abst_o mkdir -m 2775 /appl/abst/abst_o1/tmp,5
playbook i am using but it is not working as i want:
###########################################
---
- hosts: localhost
connection: local
tasks:
- name: display multiple file contents
shell: echo item
with_file:
- gpc.csv
register: command
- debug: "var={{item}} | awk -F [,] '{ print $3 }'"
with_items: command
Please help how to iterate line by line and separate with comma with awk