Sort based on the first and third characters of the fifth column:
That sort does not behave as intended. The -k5.1,5.1 restricted key never has any effect. While it restricts that key to the first character of the fifth field, since leading blanks aren't ignored by default, when using the default delimiter, 1-index is always going to be a whitespace character.
Note that if the b modifier is used in a key definition, the modifier only applies to the component to which it is attached, and the -b option (if present) is ignored. Therefore it's possible that even within the same key definition, identical indices may refer to different positions. Given the three character field, ab (space character followed by two letters): 5.1b,5.1b ==> a (1 character) 5.1,5.1b ==> a (2 characters: space, a) 5.1b,5.1 ==> (0 characters: null result since the second component points to a character preceding the starting component)
Regards,
Alister
EDIT: The thread moved on while I was preparing this post. Perhaps it's no longer relevant to the solution, but the information may still be of use to someone.
Last edited by alister; 08-21-2012 at 10:20 PM..
These 2 Users Gave Thanks to alister For This Post:
The output file wont work missing those lines mentioned.
These are the first 40 odd lines of my 1000 line vcd script file. I am looking for the changes (shown in bold & italics) for any number of occurrences of vector bits a[n],b[n] and sum[n] found anywhere else in the code.If someone can show me how these changes could be done---even for the first instance of occurrence shown here--- i think i can take it from there...
GM,
I have an issue at work, which requires a simple solution. But, after multiple attempts, I have not been able to hit on the code needed.
I am assuming that sed, awk or even perl could do what I need.
I have an application that adds extra blank page feeds, for multiple reports, when... (7 Replies)
I can't decide if I should use AWK or PERL after pouring over these forums for hours today I decided I'd post something and see if I couldn't get some advice.
I've got a text file full of hundreds of events in this format:
Record Number : 1
Records in Seq : ... (3 Replies)
hey guys,
I tried searching but most 'search and replace' questions are related to one liners.
Say I have a file to be replaced that has the following:
$ cat testing.txt
TESTING
AAA
BBB
CCC
DDD
EEE
FFF
GGG
HHH
ENDTESTING
This is the input file: (3 Replies)
I have log file that I need to extract time difference occurance when two events happend, between first occurance of TV and when W_NO happend. also read the value=, below example...I can only read the next line but not able to seach all the next lines untill i see W_NO..
Thanks for your help.... (6 Replies)
I've hunted and hunted but nothing seems to apply to what I need. Any help will be much appreciated!
My input file looks like (Unix):
marker,allele1,allele2
RS1002244,1,1
RS1002244,1,3
RS1002244,3,3
RS1003719,2,2
RS1003719,2,4
RS1003719,4,4
Most markers are listed 3 times but a few... (2 Replies)
Hi,
I have a requirement to search for a string in a large log file along with few lines before and after the the string. The following script was sufficient to search such an entry.
STRING_TO_GREP="$1"
FILE_TO_GREP="$2"
NUMBER_OF_LINES_BEFORE=$3
NUMBER_OF_LINES_AFTER=$4
for i in `grep... (3 Replies)
Hi,
I have to search those statements from the file which starts from "shanky"(only shanky, shanky09 or 09shanky is not allowed) and ends with ");". These two string can be in a same line or different line. And also i have to negate those lines which starts with #.
Can any one please give me... (2 Replies)
Good day, great gurus,
I'm new to Perl, and programming in general. I'm trying to retrieve a column of data from my text file which spans a non-specific number of lines. So I did a regexp that will pick out the columns. However,my pattern would vary. I tried using a foreach loop unsuccessfully.... (2 Replies)