Sponsored Content
Full Discussion: Issue in substitution
Top Forums Shell Programming and Scripting Issue in substitution Post 302413579 by test_user on Friday 16th of April 2010 09:25:14 AM
Old 04-16-2010
Issue in substitution

Hi ,

I have have file which has following structure

01aaaa88888000-9999
01ssss77777000-0991
01ssss7777700000991
02ssss7777700000991

The record 01 is corrupt as value from 12th field to 19th should be positive or start with - however it is 000-9999 it should be -0009999

i need to change the position of - to 12th field and add 0 in place of -
i will not touch 01 records which do not have - sign

Plz guide with approach

Thanks
 

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
ZOOMSH(1)							     Commands								 ZOOMSH(1)

NAME
zoomsh - ZOOM shell SYNOPSIS
zoomsh [-e] [-v loglevel] [commands...] DESCRIPTION
zoomsh is a ZOOM client with a simple command line interface. The client demonstrates the ZOOM API and is useful for testing targets. You may pass one or more commands to zoomsh. These commands are invoked first. OPTIONS
-e Makes zoomsh stop processing commands as soon as an error occur. The exit code of zoomsh is 1 if error occurs; 0 otherwise. -v loglevel Sets YAZ log level. EXAMPLES
If you start the yaz-ztest in one console you can use the ZOOM shell as follows: $ zoomsh ZOOM>connect localhost:9999 ZOOM>search computer localhost:9999: 7 hits ZOOM>show 0 1 1 Default USmarc 001 11224466 003 DLC 005 00000000000000.0 008 910710c19910701nju 00010 eng 010 $a 11224466 040 $a DLC $c DLC 050 00 $a 123-xyz 100 10 $a Jack Collins 245 10 $a How to program a computer 260 1 $a Penguin 263 $a 8710 300 $a p. cm. ZOOM>quit You can also achieve the same result by passing the commands as arguments on a single command line: $ zoomsh "connect localhost:9999" "search computer" "show 0 1" quit COMMANDS
connect zurl Connects to the target given by zurl. close [zurl] Closes connection to target given by zurl or all targets if zurl was omitted. show [start [count]] Displays count records starting at offset given by start. First records has offset 0 (unlike the Z39.50 protocol). quit Quits zoomsh. set name [value] Sets option name to value. get name Prints value of option name. help Prints list of available commands. SEE ALSO
yaz(7), yaz-ztest(8), Section "Building clients with ZOOM" in the YAZ manual. ZOOM home page[1]. NOTES
1. ZOOM home page http://zoom.z3950.org/ YAZ 4.2.30 04/16/2012 ZOOMSH(1)
All times are GMT -4. The time now is 09:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy