Sponsored Content
Top Forums Shell Programming and Scripting Change text at a variable position Post 302732757 by KobusE on Monday 19th of November 2012 05:57:16 AM
Old 11-19-2012
Linux Change text at a variable position

Hi there script guru's

I have an input file /tmp/in.txt of which the data is seperated by a : (example of the data)
test1:zz:2000:2000:zzz
te:a:2000:3333:bbb
testabs:x:2004:3000:cccc

I would like to run a scrip (bash) changing the data after the second ":"
example
Test for the value of 2000. If the value is 2000 do
Change the 2000 on line one(after the second ":" to 5000 - but do not change the 2000 after the third Smilie
The second line's 2000 must also changed to 5000
The 3rd line must not change (value ne 2000)

The data may vary, but the only changes that must be made to the text file will be between the second and 3rd ":"

Any help would be appreciated
Thx
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Change Position of word character

Hi, I have following format in file aaa with content below, and would like to seek help from forumer about how to change and swap the position on 2nd field. 5874957|901125| 95874960|650614| 95874966|870308| 901125 to be changed as 25-11-1990 for eg Can someone help please ?? :) ... (6 Replies)
Discussion started by: cedrichiu
6 Replies

2. Shell Programming and Scripting

Cut position as a variable

Hi All, I wish to cut an input by using the below command but i would want to have the cut position as a variable. For eg, the position number is 11 now and i wish that this number is being assigned to a variable before putting into the cut function. Can this be done ? Can any expert help?... (1 Reply)
Discussion started by: Raynon
1 Replies

3. Shell Programming and Scripting

How to change a segment in a particular position

I need help in removing a leading zero in a particular position. For eg.: XYZ*04567472*0099*020091231*0123*0.12 In the above line, I want to replace "*0123" with "123" and "0.12" with ".12". I want to remove the leading zero only in position number 4 and 5 (the bolded segments) I was able... (10 Replies)
Discussion started by: ananthmm
10 Replies

4. Shell Programming and Scripting

Change many columns position/order

Hi everyone, Please some help over here. (I´m using cygwing) I have files with 40 columns and 2000 lines in average. I´m trying to change the order position as follow. Original columns position:... (3 Replies)
Discussion started by: cgkmal
3 Replies

5. Shell Programming and Scripting

Remove text from n position to n position sed/awk

I want to remove text from nth position to nth position couple of times in same line my line is "hello is there anyone can help me with this question" I need like this ello is there anyone can help me with question 'h' is removed and 'this' removed from the line. I want to do this... (5 Replies)
Discussion started by: elamurugu
5 Replies

6. Shell Programming and Scripting

Get character position within variable

Hi all let's say i have a file named 1234_v2_abcd i need to find the position of the character located after _v, in above case this would be character number 2 the count of the characters before _v can change, but i always have a number after _v can anybody help :) (4 Replies)
Discussion started by: gigagigosu
4 Replies

7. Shell Programming and Scripting

position change

Hi All, input file: echo "a|b|c|d|test|123|same" | awk 'BEGIN {FS=OFS="|"} {print $1,$2,$7,$4,$5,$6}' Got Output : a|b|same|d|test|123 This is the sample input file with less fields. But my original file contains more field values. How to replace last value to 3rd postion value. Because... (8 Replies)
Discussion started by: Jairaj
8 Replies

8. UNIX for Dummies Questions & Answers

Change a character based on its position number

Hi I have a text file that I want to change some of the characters based on their position. My file contain multiple lines and characters should be counted continuously line by line. For example, I want to convert the 150th T to C. What can I do? Here is a portion of my file:... (10 Replies)
Discussion started by: a_bahreini
10 Replies

9. UNIX for Beginners Questions & Answers

Delete columns with a specific title XXX, where the position change in each file

Goodmorning, I know how to cut a string and a column, and how to find a word. I have a file with over 100 columns. All columns have a title in the first line. I have to delete all columns with the XXX title. I can't use cut -f because the position of XXX columns change in each file, and in... (14 Replies)
Discussion started by: echo manolis
14 Replies

10. Programming

Python variable at different position

I have a file which records banking transactions say like below. user1 has deposited 10,000$ in his account user2 has deposited 11,000$ in his account user1 has withdraw today 5000$ from his account. Lets say i read this file and convert each line as a list. username= word action=... (1 Reply)
Discussion started by: sahil_shine
1 Replies
dibbler-server(8)						      Dibbler							 dibbler-server(8)

NAME
dibbler-server - a portable DHCPv6 server DESCRIPTION
dibbler-server is a portable implementation of the DHCPv6 server. It supports both stateful (i.e. IPv6 address granting) and stateless (i.e. options granting) autoconfiguration. There are ports available for Linux 2.4/2.6 systems as well as MS Windows XP and 2003. They are freely available under GNU GPL version 2 (or later) license. SYNOPSIS
dibbler-server [ run | start | stop | status | install | uninstall ] OPTIONS
run - starts server in the console. Server can be closed using ctrl-c. start - starts server in daemon mode. stop - stops running server. status - shows status of the server. install - installs server as a service. This is not implemented yet. uninstall - uninstall server service. This is not implemented yet. EXAMPLES
Let's assume simple case: server should provide clients located on the eth1 link with IPv6 addresses from range 2000::100/120 and should have preference set to 7: iface eth0 { preference 7 class { pool 2000::100-2000::1ff } } Here is exmaple of server configured to work in a stateless mode (i.e. only options, not addresses are served). If client support option renewal, it should do so once in a 500 seconds: log-level 7 log-mode short stateless iface eth0 { option dns-server 2000::100,2000::101 option domain example.com, test1.example.com option ntp-server 2000::200,2000::201,2000::202 option time-zone CET option sip-server 2000::300,2000::302,2000::303,2000::304 option sip-domain sip1.example.com,sip2.example.com option nis-server 2000::400,2000::401,2000::404,2000::405,2000::405 option nis-domain nis.example.com option nis+-server 2000::501,2000::502 option nis+-domain nisplus.example.com option lifetime 500 } More examples can be found in the User's Guide. FILES
All files are created in the /var/lib/dibbler directory. Dibbler server reads /var/lib/dibbler/server.conf file. During operation, Dibbler saves various file in that directory. Log file is named client.log. STANDARDS
This implementation aims at conformance to the following standards: RFC 3315 DHCP for IPv6 RFC 3319 SIP options for DHCPv6 RFC 3646 DNS server options for DHCPv6 RFC 3736 Stateless DHCPv6 RFC 3898 NIS options for DHCPv6 Also options specified in following drafts are implemented: draft-ietf-dhc-dhcpv6-opt-timeconfig-03.txt NTP and timezone options. draft-ietf-dhc-dhcpv6-opt-lifetime-00.txt Option renewal. BUGS
Bugs are tracked with bugzilla, available at http://klub.com.pl/bugzilla/. If you belive you have found a bug, don't hesitate to report it. AUTHOR
Dibbler was developed as master thesis on the Technical University of Gdansk by Tomasz Mrugalski and Marek Senderski. Currently Marek has not enough free time, so this project is being developed by Tomasz Mrugalski. Authors can be reached at thomson@klub.com.pl and msend@o2.pl SEE ALSO
There is dibbler-client(8) manual page. You are also advised to take a look at project website located at http://klub.com.pl/dhcpv6/. As far as authors know, this is the only Windows DHCPv6 stateful implementation available. It is also one of two freely available under Linux. The other Linux implementation is available at http://dhcpv6.sourceforge.net, but it is rather outdated and seems not being actively devel- oped. GNU
2004-12-11 dibbler-server(8)
All times are GMT -4. The time now is 02:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy