Sponsored Content
Top Forums Shell Programming and Scripting Change some string in specific column with space Post 302961588 by k0p0nkkk on Tuesday 1st of December 2015 12:46:59 PM
Old 12-01-2015
Change some string in specific column with space

Hello All of Master Script ,
i need help to solve my problem
before :
Code:
mount  /dev/rdsk/c1t69d0s6 /dev/rdsk/c1t69d0s6 /vol/cl123/PURGE1 ufs
mount  /dev/rdsk/c1t70d0s6 /dev/rdsk/c1t70d0s6 /vol/cl123/PURGE2 ufs

expected :
Code:
mount  /dev/dsk/c1t69d0s6 /dev/rdsk/c1t69d0s6 /PURGE1 ufs
mount  /dev/dsk/c1t70d0s6 /dev/rdsk/c1t70d0s6 /PURGE2 ufs

so i need to change column 2 (from /dev/rdsk/c1t69d0s6 -> /dev/dsk/c1t69d0s6)
and column 4 (from /vol/cl123/PURGE1 -> /PURGE1 )

words in column content special character "/"

how can i get that result.
what command should i use ?
sed / awk or other best command please suggest me.
thankyou..

Last edited by Scrutinizer; 12-01-2015 at 02:12 PM.. Reason: code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk or sed command to print specific string between word and blank space

My source is on each line 98.194.245.255 - - "GET /disp0201.php?poc=4060&roc=1&ps=R&ooc=13&mjv=6&mov=5&rel=5&bod=155&oxi=2&omj=5&ozn=1&dav=20&cd=&daz=&drc=&mo=&sid=&lang=EN&loc=JPN HTTP/1.1" 302 - "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.0.3705; .NET CLR... (5 Replies)
Discussion started by: elamurugu
5 Replies

2. Shell Programming and Scripting

change character(s) in specific column

Hi all! I need to change the final e every time when it is present in any word in column 1 to a; moreover, to change the final i again to a in any word in column 1, but just if word in column 2 begins with ha or si. Here below you can see a sample of my data: achwa ungeliachwa ungeli 1... (3 Replies)
Discussion started by: mjomba
3 Replies

3. UNIX for Dummies Questions & Answers

Deleting lines that contain a specific string from a space delimited text file?

Hi, I have a space delimited text file that looks like the following: 250 rs10000056 0.04 0.0888 4 189321617 250 rs10000062 0.05 0.0435 4 5254744 250 rs10000064 0.02 0.2403 4 127809621 250 rs10000068 0.01 NA 250 rs1000007 0.00 0.9531 2 237752054 250 rs10000081 0.03 0.1400 4 17348363... (5 Replies)
Discussion started by: evelibertine
5 Replies

4. UNIX for Dummies Questions & Answers

How do i change string in a certain column number?

I have a file which looks like this 01081023442 220000000410629994812279000001099952504280000000000000000000000000010050000000000 0000000000 0000000000 1101211221099952504280000010704525042800120000000000000000000000000000000000001 0000000000000006000000000000815500000010000010000000000000... (2 Replies)
Discussion started by: reignangel2003
2 Replies

5. UNIX for Dummies Questions & Answers

Adding tags to a specific column of a space delimited text file

I have a space delimited text file with two columns. I would like to add NA to the first column of the text file. Input: 19625 10.4791768259 19700 10.8146489183 19701 10.9084026759 19702 10.9861346978 19703 10.9304364984 Output: NA19625 10.4791768259 NA19700 10.8146489183... (1 Reply)
Discussion started by: evelibertine
1 Replies

6. Shell Programming and Scripting

how to remove tab space only in the column of a specific row

Hi, I need help to remove tab delimited space in the $2 of a specific row. My file is like this:- file1.txt No_1 4 139 156 No_1 5 161 205 No_4 91 227 212 No_19 254 243 263 No_19 645 249 258 No_19 101 2492 2635 No_90 8 277 288... (5 Replies)
Discussion started by: redse171
5 Replies

7. UNIX for Dummies Questions & Answers

How can I search and change an specific string in a file

Dear All, New to Linux/Unix OS, my Linux version is 2010 x86_64 x86_64 x86_64 GNU/Linux As titled, I wonder if you can help to provide a solution to find and change an specific string in a file The file include a lots of data in following configuration but might be various in... (3 Replies)
Discussion started by: axel
3 Replies

8. Shell Programming and Scripting

Insert space in specific column among many columns

Hello, I have some problem in inserting the space for the pairs of columns. I have the input file : I used this code below in replacing it using space in specific column (replace space in each two columns) sed -e "s/,/ /2" -e "s/,/ /3" inputfile Output showed : However, I have many... (3 Replies)
Discussion started by: awil
3 Replies

9. Shell Programming and Scripting

Using sed to change values after a specific string

Hello I have a script that searches a file for a specific string and then changes the nth column after that string. I have searched online for how to do this with sed but have not seemed to find a solution that works for me. I am using bash. Some background info: - Currently I am using awk to... (4 Replies)
Discussion started by: prodigious8
4 Replies

10. Shell Programming and Scripting

Using awk to change a specific column and in a specific row

I am trying to change the number in bold to 2400 01,000300032,193631306,190619,0640,1,80,,2/ 02,193631306,000300032,1,190618,0640,CAD,2/ I'm not sure if sed or awk is the answer. I was going to use sed and do a character count up to that point, but that column directly before 0640 might... (8 Replies)
Discussion started by: juggernautjoee
8 Replies
volrmmount(1)							   User Commands						     volrmmount(1)

NAME
volrmmount - call rmmount to mount or unmount media SYNOPSIS
volrmmount [-i | -e] [name | nickname] volrmmount [-d] DESCRIPTION
The volrmmount utility calls rmmount(1M) to, in effect, simulate an insertion (-i) or an ejection (-e). Simulating an insertion often means that rmmount will mount the media. Conversely, simulating an ejection often means that rmmount will unmount the media. However, these actions can vary depending on the rmmount configuration and media type (see rmmount.conf(4)). For example, if you use the default /etc/rmmount.conf and insert a music CD, it will not be mounted. However, you can configure rmmount so that it calls workman whenever a music CD is inserted. This command allows you to override Volume Management's usual handling of media (see EXAMPLES below). OPTIONS
The following options are supported: -i Simulates an insertion of the specified media by calling rmmount. -e Simulates an ejection of the specified media by calling rmmount. -d Displays the name of the default device for volrmmount to handle. This device is used if no name or nickname is supplied. OPERANDS
The following operands are supported: name The name that Volume Management recognizes as the device's name. See volfs(7FS). nickname A shortened version of the device's name. Following is the list of recognized nicknames: +-----------------------------+-----------------------------+ | Nickname | Path | +-----------------------------+-----------------------------+ |fd |/dev/rdiskette | +-----------------------------+-----------------------------+ |fd0 |/dev/rdiskette | +-----------------------------+-----------------------------+ |fd1 |/dev/rdiskette1 | +-----------------------------+-----------------------------+ |diskette |/dev/rdiskette | +-----------------------------+-----------------------------+ |diskette0 |/dev/rdiskette0 | +-----------------------------+-----------------------------+ |diskette1 |/dev/rdiskette1 | +-----------------------------+-----------------------------+ |rdiskette |/dev/rdiskette | +-----------------------------+-----------------------------+ |rdiskette0 |/dev/rdiskette0 | +-----------------------------+-----------------------------+ |rdiskette1 |/dev/rdiskette1 | +-----------------------------+-----------------------------+ |floppy |/dev/rdiskette | +-----------------------------+-----------------------------+ |floppy0 |/dev/rdiskette0 | +-----------------------------+-----------------------------+ |floppy1 |/dev/rdiskette1 | +-----------------------------+-----------------------------+ |cdrom0 |/vol/dev/rdsk/cXtYdZ/label | +-----------------------------+-----------------------------+ |zip0 |/vol/dev/rdsk/cXtYdZ/label | +-----------------------------+-----------------------------+ |jaz0 |/vol/dev/rdsk/cXtYdZ/label | +-----------------------------+-----------------------------+ |rmdisk0 |/vol/dev/rdsk/cXtYdZ/label | +-----------------------------+-----------------------------+ EXAMPLES
Example 1: Using the volrmmount command When Volume Management finds a floppy that contains a filesystem, it calls rmmount to mount it. If you wish to run tar(1) or cpio(1) on that floppy, it must first be unmounted. To unmount the floppy use: example% volrmmount -e floppy0 After volrmmount unmounts the floppy, if you wish to re-mount it (rather than ejecting it and reinserting it) use: example% volrmmount -i floppy0 Notice that if you are using a named floppy, you can use its name in place of floppy0. FILES
/dev/volctl Volume Management control port ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWvolu | +-----------------------------+-----------------------------+ SEE ALSO
cpio(1), eject(1), tar(1), rmmount(1M), vold(1M), rmmount.conf(4), attributes(5), volfs(7FS) NOTES
Volume Management (vold) must be running to use this command. SunOS 5.10 30 Aug 2000 volrmmount(1)
All times are GMT -4. The time now is 09:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy