01-29-2009
There are tons of guide, howtos etc on the net, even some machines have man page for awk installed. Check for the "length" function.
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 DEBIAN
tv_check
TV_CHECK(1p) User Contributed Perl Documentation TV_CHECK(1p)
NAME
tv_check - Check TV guide listings
SYNOPSIS
tv_check --configure|--scan [other options]
DESCRIPTIONS
tv_check is a Perl script that reads in a file with show information and checks it against a TV guide listing, reporting on upcoming
episodes and alerting you to unexpected episodes or schedule changes.
OPTIONS
--configure Run configuration GUI. Either this option or --scan must be provided.
--season-reset special --configure option to remove everything but the title to help new season setup. The idea is to keep everything a
"title-only" search until seasons begin. Then you update the details including record device. *expirimental*
--scan Scan TV listings. Either this option or --configure must be provided.
--myreplaytv=UNIT,USERNAME,PASSWORD ** Feature removed ** This option used to auto-populate a config file based on myreplaytv.com.
--shows=FILE Specify the name of XML shows file (default: shows.xml).
--guide=FILE, --listings=FILE Specify the name of XML guide file (default: guide.xml).
--html Generate output in HTML format.
--bluenew Highlights new episodes in blue (helpful back when there was an off-season)
--output=FILE Write to FILE rather than standard output
--help Provide a usage/help listing.
SEE ALSO
xmltv(5).
AUTHOR
Robert Eden; manpage by Kenneth J. Pronovici.
perl v5.14.2 2011-06-13 TV_CHECK(1p)