Sponsored Content
Full Discussion: ID generation in sequence
Top Forums Shell Programming and Scripting ID generation in sequence Post 302370887 by rdcwayx on Thursday 12th of November 2009 06:27:00 PM
Old 11-12-2009
If all lines are same format,
Code:
awk '{gsub(/<id><id>/,"<id>"NR"<id>"); print }' urfile
awk '{gsub(/<id><id>/,"<id>"NR"<id>")}1' urfile

If not,
Code:
awk 'BEGIN {id=1} {gsub(/<id><id>/,"<id>"id++"<id>"); print }' urfile
awk 'BEGIN {id=1} {gsub(/<id><id>/,"<id>"id++"<id>")}1' urfile

 

9 More Discussions You Might Find Interesting

1. Programming

Shellcode Generation using C

Hi, I was just learning about buffer overflow attacks... I was curious as to how to generate a simple shellcode. I've written two codes - One is the typical program that has a vulnerability inside and the other is the shellcode. main program: void test(); int main() { test(); ... (2 Replies)
Discussion started by: Legend986
2 Replies

2. Shell Programming and Scripting

Sequence number generation on a key column

Hi Folks, Can you help me with this issue: I have to generate the numbers say from 1001 for each record in a file based on a key field, the catch is the generated number should be unique based on key column. (EMP_NUMBER) Example: Input File: EMP_NUMBER EMP_NAME 8908 ... (6 Replies)
Discussion started by: sbasetty
6 Replies

3. Shell Programming and Scripting

Graph generation

How can I generate graphs using perl in unix solaris environment? Please suggest. (2 Replies)
Discussion started by: wadhwa.pooja
2 Replies

4. Shell Programming and Scripting

Help with excelsheet generation

Hi All, i have around 50 queries in sybase. We have a requirement where we need to write a unix script, which execute the query one by one & generate the excel sheet & send it to user. I have completed half of the part, where i am executing query one by one & putting the result into a .txt... (4 Replies)
Discussion started by: Amit.Sagpariya
4 Replies

5. Shell Programming and Scripting

Config Generation

I'm looking for good ways to handle config generation. I have been rolling my own for a few years now, but I'm wondering if there is a better way and would like to get some advice from anyone who has any ideas or experience in doing this. Here are some things I want to achieve in generating... (1 Reply)
Discussion started by: humbletech99
1 Replies

6. Shell Programming and Scripting

Character generation

I need a (bash) script to echo to the screen all possible 4 character hex combinations of: A-F, 0-9. I beleive there are 65,535 approx combos. Output something like this: 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A ... ... FFFE FFFF (6 Replies)
Discussion started by: ajp7701
6 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

Sequence generation in shell

Hi, I am using the nested for loops to generate the sequence , taking start and end sequence number input from test.txt (sample content mentioned below). Also , can I print the rest of columns as well with sequence number into the same file. for i in `cat test.txt|cut -d"," -f7` do ... (8 Replies)
Discussion started by: tushar.modgil
8 Replies

9. Shell Programming and Scripting

Help with file generation

Dear all Hope you are doing good. I've requirement where in I need to generate a file containing set of SQLs as per the inputs. My script flow is like reading few parameters using read command to read input to script and process the inputs. However at one of the input, my script has to... (3 Replies)
Discussion started by: tenderfoot
3 Replies
IPTABLES-XML(8) 														   IPTABLES-XML(8)

NAME
iptables-xml -- Convert iptables-save format to XML SYNOPSIS
iptables-xml [-c] [-v] DESCRIPTION
iptables-xml is used to convert the output of iptables-save into an easily manipulatable XML format to STDOUT. Use I/O-redirection pro- vided by your shell to write to a file. -c, --combine combine consecutive rules with the same matches but different targets. iptables does not currently support more than one target per match, so this simulates that by collecting the targets from consecutive iptables rules into one action tag, but only when the rule matches are identical. Terminating actions like RETURN, DROP, ACCEPT and QUEUE are not combined with subsequent targets. -v, --verbose Output xml comments containing the iptables line from which the XML is derived iptables-xml does a mechanistic conversion to a very expressive xml format; the only semantic considerations are for -g and -j targets in order to discriminate between <call> <goto> and <nane-of-target> as it helps xml processing scripts if they can tell the difference between a target like SNAT and another chain. Some sample output is: <iptables-rules> <table name="mangle"> <chain name="PREROUTING" policy="ACCEPT" packet-count="63436" byte-count="7137573"> <rule> <conditions> <match> <p>tcp</p> </match> <tcp> <sport>8443</sport> </tcp> </conditions> <actions> <call> <check_ip/> </call> <ACCEPT/> </actions> </rule> </chain> </table> </iptables-rules> Conversion from XML to iptables-save format may be done using the iptables.xslt script and xsltproc, or a custom program using libxsltproc or similar; in this fashion: xsltproc iptables.xslt my-iptables.xml | iptables-restore BUGS
None known as of iptables-1.3.7 release AUTHOR
Sam Liddicott <azez@ufomechanic.net> SEE ALSO
iptables-save(8), iptables-restore(8), iptables(8) Jul 16, 2007 IPTABLES-XML(8)
All times are GMT -4. The time now is 11:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy