This is very close. Based on one of the prior code I managed to put together, the final step would be taking this output and using it in the following manner.
Theoretically speaking.
I will try this with via a for loop, the final index of len or a pipe once I am awake and let you know what the final code looks like.
Dear All,
To find the length of the longest line from a file i have used wc -L which is giving the proper output...
But the problem is AIX os does not support wc -L command.
so is there any other way 2 to find out the length of the longest line using awk or sed ?
Regards,
Pankaj (1 Reply)
Hi Everyone,
I am trying to write a shell script that can find the longest phrase that appears at least twice in an online news article. The HTML has been parsed through an HTML parser, converted to XML and the article content extracted. I have put this article content in a text file to work... (24 Replies)
i have a file that looks like this
ABC123
aaaaaaaaaaaaaaasssssssssssssssffhhh
ABC234
EMPTY
ABC652
jhfffffffffffffffffffffffffffffffffffkkkkkkkkkkkk
i want to grep "EMPTY" and print ABC234 (3 Replies)
I'm trying find and print a number after a specific user passed string in each line of a text file using C (as requested by the powers that be). I've pieced together enough to read the file, find the string and print the line it was found on but I’m not sure where to even start in terms of finding... (3 Replies)
I would be grateful if someone could help me. I am trying to write a .sh script in UNIX.
I have the following code;
User=john
User=james
User=ian
User=martin
for x in ${User}
do
print ${#x}
done
This produces the following output;
4
5
3
6 (12 Replies)
I met a challenge to filter ~70 millions of sequence rows and I want using awk with conditions:
1) longest string of each pattern in column 2, ignore any sub-string, as the index;
2) all the unique patterns after 1);
3) print the whole row;
input:
1 ABCDEFGHI longest_sequence1
2 ABCDEFGH... (12 Replies)
Can I do this in one awk session. Solution I have is poor.
I want to return the number after PID.
echo "Start: 12345 is used by PID:11111 username" | awk -F: '{print $3}' | awk '{print $1}' (6 Replies)
Ok I would like to do the following
file test contains the following lines. between the lines ABC there may be any amount of lines up to the next ABC entry.
I want to grep for the filename.txt entry and print the lines in between (and including that line) up to and including the last line... (3 Replies)
Hello experts,
I am trying to unscramble a mixed signal into component signals.
Let the list of known signals be
$ cat tmplist
DU
DU4016
GFF
GFF2010
GFF201019
G2115
G211
DU40 (1 Reply)
Hi,
Let's say I have a pipe-separated input like so:
name_10|A|BCCC|cat_1
name_11|B|DE|cat_2
name_10|A|BC|cat_3
name_11|B|DEEEEEE|cat_4
Using awk, for records with common field 2, I am trying to replace all the shortest substrings by the longest string in field 3.
In order to get the... (5 Replies)