01-29-2009
Checking the length using awk??
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
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am trying to display df -h command out in proper format, how can I display
each field of each record in a fixed length. (2 Replies)
Discussion started by: roopla
2 Replies
2. Shell Programming and Scripting
Hi Unix Champs,
I want to awk on a fixed length file.
Instead if the file was a delimited file, then I could have used -F and then could have easily done manipulation on the fields.
How do i do the same in case of fixed length file?
Thanks in Advance.
Regards. (7 Replies)
Discussion started by: c2b2
7 Replies
3. 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
4. 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
5. Shell Programming and Scripting
Hi,
I have requirement where record length is stored in an variable RECORD_LENGTH
Code goes as follows
RECORD_LENGTH=537
the above is arrived from
#RECORD_LENGTH=`awk -F"=" '{$sum+=$2} END{print $sum}' DBP_Claims_CFG.ini`
awk '
{
if (length() == '$RECORD_LENGTH')
print FNR, $0... (4 Replies)
Discussion started by: ainuddin
4 Replies
6. Shell Programming and Scripting
Hi Folks -
I'm quite new to awk and didn't come across such issues before. The problem statement is that, I've a file with duplicate records in 3rd and 4th fields. The sample is as below:
aaaaaa|a12|45|56
abbbbaaa|a12|45|56
bbaabb|b1|51|45
bbbbbabbb|b2|51|45
aaabbbaaaa|a11|45|56
... (3 Replies)
Discussion started by: asyed
3 Replies
7. 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
8. Shell Programming and Scripting
Morning, every one.
I have a file like this:
AAEQGAGNQPQH 27
AAGETQY 51
AAGGSSYNEQF 12
AAGGYEQY 72
AAGLEAKNIQY 159
AAGPYEQY 26
AAGQDYNSPLH 45
AAGQGGEQF 1587
AAGREGGNTEAF 4
AAGSPQH 3
AAGSYEQY 45
AAGTGAYEQY 19
AAGTSGNNEQF 79
AAGWNTEAF 37
I want to count the string length of the... (2 Replies)
Discussion started by: xshang
2 Replies
9. Shell Programming and Scripting
Hello, I have the following input data:
A C
AA GG
A G
CG AG
the code I tried:
awk -F" " '{ if ((length($1==1) && (length($2==1))) input_file
is not working, I need the output to be (such that only the columns containing one letter are printed)
A C
A G
Any help would be appreciated! (5 Replies)
Discussion started by: Rabu
5 Replies
10. Shell Programming and Scripting
My question is basically as the title says. How can I check a user inputted string is only certain characters long (for example, 3 characters long) and how do I check a user inputted string only contains certain characters (for example, it should only contain the characters 'u', 'a', 'g', and 'c')... (4 Replies)
Discussion started by: Eric1
4 Replies
LEARN ABOUT OSF1
rapi_fmt_filtspec
rapi_fmt_filtspec(3) Library Functions Manual rapi_fmt_filtspec(3)
NAME
rapi_fmt_filtspec - Format an RSVP API (RAPI) filter spec
LIBRARY
RAPI Library (librsvp.so, librsvp.a)
SYNOPSIS
#include <rapi.h>
void rapi_fmt_filtspec( rapi_filter_t *filtp, char *buffer, int length);
PARAMETERS
Points to an RAPI filter spec. Points to a buffer that is to contain the formatted filter spec. Specifies the length, in bytes, of the
buffer that is to contain the formatted filter spec.
DESCRIPTION
The rapi_fmt_filtspec() routine reads a given RAPI filter spec and formats it into a fixed length buffer whose address is specified by buf-
fer and whose size is specified by length. If the buffer size is too small, the formatted filter spec is truncated.
RELATED INFORMATION
Functions: rapi_event_rtn_t(3), rapi_fmt_adspec(3), rapi_fmt_flowspec(3), rapi_fmt_tspec(3).
Network: RSVP(7). delim off
rapi_fmt_filtspec(3)