Sponsored Content
Full Discussion: Hex numbering sequence
Top Forums Shell Programming and Scripting Hex numbering sequence Post 302459010 by rdcwayx on Sunday 3rd of October 2010 07:28:10 AM
Old 10-03-2010
Updated: seems I misunderstand. Anyway put the code here.
Code:
cat infile
Group ID 036A, members below;
members 036B:036D;

Group ID 036E, members below;
members 036F:0371;


awk -F"[:; ]" '/^members/ {for (i=strtonum("0x"$2);i<=strtonum("0x"$3);i++) printf "%s %04X\n", $1,i;next}1' infile

Group ID 036A, members below;
member 036B
member 036C
member 036D

Group ID 036E, members below;
member 036F
member 0370
member 0371


Last edited by rdcwayx; 10-03-2010 at 08:34 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Numbering!

Just a shot question... how to make 1,2,3,...999 into the form of 001,002,003....999 (3 digits) Thanks.... (9 Replies)
Discussion started by: biglemon
9 Replies

2. Shell Programming and Scripting

Numbering

I'm trying to do a script that will look for a log file if it is already there change the name to another name. I.E if log.0 is there rename to log.1 rename log.1 to log.2 rename log.2 to log.3 and so on. Only thing is I got no idea where or what is the best command to use for this? ... (3 Replies)
Discussion started by: merlin
3 Replies

3. UNIX for Advanced & Expert Users

numbering blanks

hello i'm trying to figure out how to number a blank line. For instance this : sed '/./=' file | sed '/./N; s/\n/ /' gives me 1 aaaa 2 bbbbbb 4 cccccc 5 ffkkkfff 6 ffsdfdfs I would like something like this: 1 aaaaa 2 3 bbbbbb 4 5 cccccc And so... (6 Replies)
Discussion started by: wisher115
6 Replies

4. Shell Programming and Scripting

Reverse numbering of image sequence

Hi, I have several folders full of image sequences from an animation. The image frames are named Frame0001.png to Frame0900.png, somewhere along the way the images have been named in reverse order. Is there a script that read the contents of a folder and renumber the files Frame0001.png -... (1 Reply)
Discussion started by: BlightyDevil
1 Replies

5. Programming

After converting the hexstr to Hex and storing the Hex in a char*

Hi All, My main intension of is to convert the Hexstring stored in a char* into hex and then prefixing it with "0x" and suffix it with ',' This has to be done for all the hexstring char* is NULL. Store the result prefixed with "0x" and suffixed with ',' in another char* and pass it to... (1 Reply)
Discussion started by: rvan
1 Replies

6. Programming

What is the difference between ios::hex and std::hex?

Hi, Is there really a difference between these two, std::hex and ios::hex?? I stumbled upon reading a line, "std::ios::hex is a bitmask (8 on gcc) and works with setf(). std::hex is the operator". Is this true? Thanks (0 Replies)
Discussion started by: royalibrahim
0 Replies

7. Shell Programming and Scripting

find common entries and match the number with long sequence and cut that sequence in output

Hi all, I have a file like this ID 3BP5L_HUMAN Reviewed; 393 AA. AC Q7L8J4; Q96FI5; Q9BQH8; Q9C0E3; DT 05-FEB-2008, integrated into UniProtKB/Swiss-Prot. DT 05-JUL-2004, sequence version 1. DT 05-SEP-2012, entry version 71. FT COILED 59 140 ... (1 Reply)
Discussion started by: manigrover
1 Replies

8. Shell Programming and Scripting

Incremental numbering?

Would it be possible for a script to duplicate a file and incrementally number it? File in: XXX_007_0580_xxxx_v0016.aep File out: XXX_007_0580_xxxx_v0017.aep If someone knows of a way I'd love to see it. Thanks! (7 Replies)
Discussion started by: scribling
7 Replies

9. Shell Programming and Scripting

Hex number sequence help

Need some help doing this ... with awk maybe Input 0DF6 0DF7 0DF8 0DF9 0DFA 0DFB 0DFC 0DFD 0DFF 0E00 0E01 0E02 0E03 0E04 0E05 0E06 (11 Replies)
Discussion started by: greycells
11 Replies

10. Shell Programming and Scripting

How to replace with "sed" some hex values by other hex values?

Assume I have a file \usr\home\\somedir\myfile123.txt and I want to replace all occurencies of the two (concatenated) hex values x'AD' x'A0' bytwo other (concatenated) hex values x'20' x'6E' How can I achieve this with the gnu sed tool? Additional question: Is there a way to let sed show... (1 Reply)
Discussion started by: pstein
1 Replies
NNGREP(1)						      General Commands Manual							 NNGREP(1)

NAME
nngrep - grep for news group names (nn) SYNOPSIS
nngrep [ -ainprsu ] [ -l ] [ pattern ] DESCRIPTION
nngrep can print various selections of the available news groups. Without options, nngrep will list all currently subscribed newsgroups whose name matches any of the specified patterns. If no pattern is specified, all subscribed groups will be listed. The selection of news groups against which the patterns are matches, and subsequently printed by nngrep can be limited or expanded using the following command line options and arguments: -a Use both subscribed and unsubscribed groups. Overrides the -u option. -i Use only ignored groups, i.e. which are not in the presentation sequence. -n Use only new groups. Notice that nn considers a group to be new until you have read at least one article in the group, or you have unsubscribed to the group. This means that even reasonable active news groups may remain "new" for quite some time if it only con- tains articles which are cross-posted to other groups which occur earlier in your presentation sequence. -p Use only groups with unread (pending) articles. -r Use only read groups, i.e. without unread articles. -s Use only groups which are in the presentation sequence. -u Use only unsubscribed groups. These options can be combined if they don't logically exclude each other. For example, to get the names of all "source" groups, you can use the command nngrep source You can use this to read a specific subset of news groups with nn; for example nn `nngrep -sp source` LONG LISTING
A long listing of the matched groups can be requested with the -l option. It will include the following information: SUBSCR Specifies whether the group is subscribed or not (yes/no). NEW Specifies whether the group is new or not (yes/no). UNREAD Shows the number of unread articles in the group (if any). SEQUENCE Shows the group's index in the presentation sequence. GROUP The name of the group. FILES
~/.newsrc The record of read articles ~/.nn/init The presentation sequence SEE ALSO
nn(1), nncheck(1), nngoback(1), nngrab(1), nnpost(1), nntidy(1) nnadmin(1M), nnusage(1M), nnmaster(8) AUTHOR
Kim F. Storm, Texas Instruments A/S, Denmark E-mail: storm@texas.dk 4th Berkeley Distribution Release 6.6 NNGREP(1)
All times are GMT -4. The time now is 05:58 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy