Sponsored Content
Full Discussion: Issue in substitution
Top Forums Shell Programming and Scripting Issue in substitution Post 302413989 by vino on Monday 19th of April 2010 01:14:51 AM
Old 04-19-2010
Quote:
Originally Posted by test_user
Thanks a ton actually record length is 300 characters and error characters
0000-9999 is from 180th to 189th
plz guide in that scenario
I have posted
Code:
sed -e "s/^\(...........\)\([^-]*\)-\(.*\)/\1-\2\3/g" input.txt

and
Code:
^\(.\{11\}\)

Do use the above two and create the sed statement you require.
 

10 More Discussions You Might Find Interesting

1. Solaris

Variable Substitution Issue

#!/bin/ksh VAR_ONE=HELLO TEMP=ONE echo $VAR_${TEMP} ## Output is: ONE Hi, I want the output to echo HELLO and not ONE as the above script does. I know I am missing something with dollar substitution. Can anyone help me out ? Thanks. Cal (4 Replies)
Discussion started by: calredd
4 Replies

2. Shell Programming and Scripting

Difference between "Command substitution" and "Process substitution"

Hi, What is the actual difference between these two? Why the following code works for process substitution and fails for command substitution? while IFS= read -r line; do echo $line; done < <(cat file)executes successfully and display the contents of the file But, while IFS='\n' read -r... (3 Replies)
Discussion started by: royalibrahim
3 Replies

3. Shell Programming and Scripting

Substitution

All, I have this text document that contains a listing(See below). What i would like to ask is how i could extract just the information i need which is the files name (CWS*****.***.gz) If anyone has any suggestions i would be very grateful. I am sure its relatively simple but i just... (6 Replies)
Discussion started by: Andyp2704
6 Replies

4. Shell Programming and Scripting

encrytion/substitution issue in a file

1) ABC::2197.12:2197.12:120217144365::+DEF:INT:1:N::::6:550.00:0.00:2009-04-29:CN:4547425069636596::6:N:mrs charles:N:PH:00010031:0001' OUTPUT - ABC::2197.12:2197.12:120217144365::+DEF:INT:1:N::::6:550.00:0.00:2009-04-29:CN:4547******636596::6:N:mrs charles:N:PH:00010031:0001' The... (5 Replies)
Discussion started by: mad_man12
5 Replies

5. Shell Programming and Scripting

vi substitution

Hello, I'm trying to do a substitution in vi. which adds a field for the year to a line. If the line doesnt include a year, it should still add a field (although empty) the fields are: Country:number:number:name(and sometimes year):place this is a desired in and output: Sweden:55:32:John... (2 Replies)
Discussion started by: drareeg
2 Replies

6. Shell Programming and Scripting

sed pattern substitution issue?

Hello everyone ... I'm going crazy, I hope some of you can help me ... I have to replace a line in a crontab like this: 5 2 * * 2 root backupdat with this: 5 5 * * 3 root backupdat the command I use is the following: sed -i.bak -e 's/5 2 * * 2 root backupdat/5 5 * * 3 root... (4 Replies)
Discussion started by: ionral
4 Replies

7. Shell Programming and Scripting

Issue with substitution using sed

Hi all Having issue with substitution using sed Trying to assign the absolute path of the file to the variable 'floc' returned by the find command floc=`find / -name $fname` eg cat $floc '/root/samplecheck/myfile' I want to replace '/' with '->' in the 'floc' i am using the below sed... (2 Replies)
Discussion started by: amithsebkanattt
2 Replies

8. Shell Programming and Scripting

Variable value substitution issue with awk command issue

Hi All, I am using the below script which has awk command, but it is not returing the expected result. can some pls help me to correct the command. The below script sample.ksh should give the result if the value of last 4 digits in the variable NM matches with the variable value DAT. The... (7 Replies)
Discussion started by: G.K.K
7 Replies

9. Shell Programming and Scripting

Substitution Issue with nawk

Hi, I'm trying to reformat some badly formatted XML that I've extracted from Oracle clob columns using the following nawk command: nawk '{gsub(/&lt;/,/>\n/); print}' test.raw > test.xml the substitution executes fine, but instead of subbing &lt; with > followed by newline, it subs the &lt; with a... (3 Replies)
Discussion started by: sffuji
3 Replies

10. Shell Programming and Scripting

Substitution

I am trying to do some substitutions using the substitution operator (:%s) in a text file. I want to replace all A1, A2, A3.......A100 in my text file. I used :%s/A2/SAE/g successfully until A9 but when I use A1, all the A11 to A19 is changed. How do I specify the exact match here? (8 Replies)
Discussion started by: Kanja
8 Replies
IN.IDENTTESTD(8)						 Library functions						  IN.IDENTTESTD(8)

NAME
in.identtestd - a small daemon that can be used to test Ident servers SYNOPSIS
in.identtestd DESCRIPTION
in.identtestd is a small daemon (to be started from inetd) that does an ident lookup on you if you telnet into it. Can be used to verify that your Ident server is working correctly. The source code can be found in the debian libident source package, as ident-tester.c. EXAMPLE
A typical entry in /etc/inetd.conf would be: 9999 stream tcp nowait root /usr/sbin/in.identtestd in.identtestd With the above entry in place and active, execute "telnet hostname 9999" from either this system, or another system. It should show some- thing like: Trying hostname... Connected to hostname. Escape character is '^]'. Welcome to the IDENT server tester, version 1.9 (Linked with libident 0.22 Debian) Connecting to Ident server at 192.168.1.1... Querying for lport 1109, fport 9999.... Reading response data... Userid response is: Lport........ 1109 Fport........ 9999 Opsys........ UNIX Charset...... <not specified> Identifier... paul Connection closed by foreign host. AUTHOR
Peter Eriksson <pen@lysator.liu.se> Manpage written for debian by Paul Slootman <paul@debian.org>. SEE ALSO
ident(3), identd(8), tcpd(8) 3rd Berkeley Distribution IN.IDENTTESTD(8)
All times are GMT -4. The time now is 04:28 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy