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.
I am a beginner to scripting, please help me in this regard.
How do I create a script that provides a count of distinct values of all the fields in the pipe delimited file ? I have 20 different files with multiple columns in each file.
Hello All,
I have a .CSV file where I expect all numeric data in all the columns other than column headers.
But sometimes I get the files (result of statistics computation by other persons) like below( sample data)
Code:
SNO,Data1,Data2,Data3
1,2,3,4
2,3,4,SOME STRING
3,4,Inf,5
4,5,4,4
I want to remove the columns where ever character strings( I cannot provide the complete list as it is
Hi all,
Can you please help me to find out that where is the problem in my script or either my way of writing the shell command on the prompt is not right? Actually, I want to compare the second column "$1" of the file "t1" with all the columns of second file "t2", if there is a match then the script should return the matched column.
Hi,
I have 20 tab delimited text files that have a common column (column 1). The files are named GSM1.txt through GSM20.txt.
Hi All,
i have a CSV file like below,
col1 col2 col3 col4 col5 col6 col7
a1 a2 a3 a4 a5 a6 a7
b1 b2 b3 b4 b5 b6 b7
c1 c2 c3 c4 c5 c6 c7
d1 d2 d3 d4 d5 d6 d7
Col1,col2.. are the column names and a1,a2,b1,b2..
Hi,
I wanted to check whether the x,y,z coordinates of two files are equal or not. At times, when one file is converted to another suitable file extension , there are some chances that the data mismatch would happen during the conversion. In order to avoid the data misfit, i would like to compare the co-ordinates of the both files and check whether they are equal or not.
Hi List,
I have a CSV file which I am manipulating. Each time I receive the CSV for processing, there will be extra columns of data.
Here's what I want to do; I want to be able to remove specific columns from the CSV data file, but keep the remaining columns, where the remaining columns are variable in how many columns there are.
I have a tool which generates results in a file at every minute and which has following columns.
I need to create a script checks this file constantly and if Column ( QOM ) has value more then "30S" it should send an email.
Can anybody help ?