10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have two files, file1 and file2 who have identical number of rows and columns. However, the script is supposed to be used for for different files and I cannot know the format in advance. Also, the number of columns changes within the file, some rows have more and some less columns (they are... (13 Replies)
Discussion started by: maya3
13 Replies
2. Shell Programming and Scripting
Hi All
I am using the below code to check the number of columns in a delimited file are same as expected. Code is give below
awk -F '|' -v line=$2 'NF!=line {print NF,$0}' file
Here the challenge is that , delimiter is different for each file, it can be pipe, comma, or semi colon.I want to... (4 Replies)
Discussion started by: ginrkf
4 Replies
3. Shell Programming and Scripting
Hello All,
I have a requirement in which i will be given a sql query as input in a file with dynamic number of columns. For example some times i will get 5 columns, some times 8 columns etc up to 20 columns.
So my requirement is to generate a output query which will have 20 columns all the... (7 Replies)
Discussion started by: vikas_trl
7 Replies
4. Shell Programming and Scripting
Hello,
I am newbie to bash scripting. Could someone help me with the following.
I have log file with output as shown below
**************************LOG*************************
11/20/2013 9:11:23.64 Pinging xx.xx.xx.xx with 32 bytes of data:
11/20/2013 9:11:23.64 Reply from xx.xx.xx.xx:... (4 Replies)
Discussion started by: meena_2013
4 Replies
5. Shell Programming and Scripting
hi,
i have a file with many records and each record may or may not have 6 columns.
for example
file1 :
first second third fourth fifth sixth
first second third fourth fifth
first second third fourth fifth sixth
first second third fourth fifth sixth seventh eigth
if i cat the file and... (21 Replies)
Discussion started by: Little
21 Replies
6. Shell Programming and Scripting
How to find the number of columns in xml file.
i tried following command.
#!bin/ksh
cat $1 | grep -c "</mdm:attribute>"
exit 0
but i am not getting accurate result which is not matching with the manual count.
data format :
<mdm:attribute> value </mdm:attribute> (6 Replies)
Discussion started by: victory
6 Replies
7. Shell Programming and Scripting
Hello Guys
I have a flat file with few thousands of rows.
Now each rows have different number of columns
I want to delete the rows which has not equal to 749 columns
Can you guys please let me know how to do the same
Your help is much appreciated. (2 Replies)
Discussion started by: Pratik4891
2 Replies
8. Shell Programming and Scripting
Hi,
I want to subtract a number from all columns except the first column. I have a number of files each having different columns around 60/70. How to do that in awk or any other command?
Thanks
Input
Col 1 Col 2 Col3 - - - - Col55
1 .0123 .098 - - - 0.6728
2 - -... (3 Replies)
Discussion started by: Surabhi_so_mh
3 Replies
9. Shell Programming and Scripting
i have a file which may have 'n' number of columns
1 222 fafda 32 afdaf 4343 4343
234 43fdaf 4343 fdd fdfd fdfd fdd fdfd fdfd
fdfd fdfd fdfd fdd fdfd fdfd
need to concatenate the columns with... (3 Replies)
Discussion started by: mlpathir
3 Replies
10. Shell Programming and Scripting
I get the point of number subtraction in one column
awk 'NR==1 {n=$1; next}; {n-=$1} END {print n}' inputfile
but I cannot figure it out how to do this to multiple
columns.
awkward. (6 Replies)
Discussion started by: awkward
6 Replies