10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I could calculate the length of entire fasta sequences by following command,
awk '/^>/{if (l!="") print l; print; l=0; next}{l+=length($0)}END{print l}' unique.fasta
But, I need to calculate the length of a particular fasta sequence specified/listed in another txt file. The results to to be... (14 Replies)
Discussion started by: dineshkumarsrk
14 Replies
2. UNIX for Dummies Questions & Answers
I want to get count on number of records in a few folders by running grep command for more than two columns in a row of fixed length file.
suppose if i have a fixed length file has 5 columns and I want to see the record counts for country =can and province = bc and time stamp <= 12 feb 2013... (14 Replies)
Discussion started by: princetd001
14 Replies
3. Shell Programming and Scripting
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
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. It was simply... (6 Replies)
Discussion started by: PikK45
6 Replies
4. Shell Programming and Scripting
Hi..
Just got a problem with awk and cannot figure out whats the issue. I am not really expert in awk so looking for help/opinion from experts
Command is
$ cat abinaryfile | sed -e "s/@@//g;s/@$//" | awk ' begin {} { printf(length($0)); }'
Well its a binary file and I am... (3 Replies)
Discussion started by: iffarrukh
3 Replies
5. Shell Programming and Scripting
Hi, Gurus,
I have a requirement which need count string length.
eg.
abc
bcde
defge
want to get following:
abc 3
bcde 4
defge 5
:wall:
thanks in advance! (6 Replies)
Discussion started by: ken002
6 Replies
6. Shell Programming and Scripting
I am trying to write a shell scrip that can give me the line length of a record that was in EBDIC and then converted to ASCII. Everything I try reports 1 yet the length is 2000+. I have tried
echo "Line length : ${#FILE}"
echo "FILE" |awk -F, '{print NF}'
awk '{lenth(file)}'
All I can... (11 Replies)
Discussion started by: wbshrk
11 Replies
7. Shell Programming and Scripting
I am trying to use the following code:
awk '{s=$0;if(length(s) < 750){getline; s=s " " $0}printf("%s\n",s)}' filename
but an error shows that 'awk' is too long. Is there a limit to the awk length function? and what could be an alternate solution for long fixed width records?
The code... (3 Replies)
Discussion started by: CKT_newbie88
3 Replies
8. Shell Programming and Scripting
I have following data in a file a.txt
HELLO123456789
HELLO098765432
HELLO322366565
HELLO2343435
HELLO45343
I have to filter those lines whose length is not equal to 14 using awk.
Thanks in advance:b: (1 Reply)
Discussion started by: nohup
1 Replies
9. Shell Programming and Scripting
Hi Friends,
Need some help in AWK.
Working on AIX 5
Have been trying the following functionality to make the record length fixed:
if( length(record) < 300 )
{
printf("%-300s\n", record);
}
In my opinion it will apply some fillers in the end.
Its is not making any... (4 Replies)
Discussion started by: kanu_pathak
4 Replies
10. UNIX for Dummies Questions & Answers
Please can anyone tell me, how to count the string length (2 Replies)
Discussion started by: Anshu
2 Replies