I have a comma (,) delimited file.
Code:
106232145,"medicare","medicare,medicaid",789
I would like to count the number of fields in each line.
I tried the below code
Code:
awk -F ',' '{print NF-1}'
This returns me the result as 5 instead of 4.
Hello All,
I got a requirement when I was working with a file. Say the file has unloads of data from a table in the form
Code:
1|121|asda|434|thesi|2012|05|24|
1|343|unit|09|best|2012|11|5|
I was put into a scenario where I need the field count in all the lines in that file.
I have a file which contains fields comma separated & with each field surrounded by quotes. The 4th field contains either a serial number, the text ABC, the text XYZ or it's blank. I want to only extract records which have a serial number.
Hi All,
I am really new to Shell Scripting and would appreciate any help here.
I have a script that runs throguh a cron job on a daily basis, problem is when the file is attached and e-mailed, it uses a comma delimiter to seperate fields.
How can I prevent the script from using a comma delimiter, maybe even changing the delimiter to something like a pipe delimiter?
Hi !
input:
Code:
111|222|333|aaa|bbb|ccc
999|888|777|nnn|kkk
444|666|555|eee|ttt|ooo|ppp
With awk, I am trying to change the FS "|" to "; " only from the 4th field until the end (the number of fields vary between records).
In order to get:
Code:
111|222|333|aaa; bbb; ccc
999|888|777|nnn; kkk
444|666|555|eee; ttt; ooo; ppp
I tried something like:
Cod
Hello there,
I have a comma separated csv , and all the text field is wrapped by double quote. Issue is some text field contain comma as well inside double quote.
Hello All,
I need to convert a csv file to pipeline delimiter file in UNIX. The data in file itself contains comma with double qouted qualifier apart from the comma separator. Let me know how to do it.
Hello Everyone,
This 10th field is giving too much problem in AWK. How do i overcome ?
Hello all,
I was wondering if there was a way to change the default GECOS fields on a user. Now, I don't mean change their name, number, shell, etc.