Sponsored Content
Full Discussion: Keeping the number intact
Top Forums Shell Programming and Scripting Keeping the number intact Post 302587892 by birei on Friday 6th of January 2012 07:53:03 AM
Old 01-06-2012
Hi kristinu,

You may need the GNU version of 'sed' to use next command:
Code:
$ ... | sed 's/\([0-9]\+\(\.[0-9]\+\)\?\)/ \1 /g'
n 02 -z 30 -dsr 65 -terr 0.50 -dc 0.05 - 4 x 3 smp.cmd
n 02 -z 30 -dsr 65 -terr 0.50 -dc 0.01 - 8 x 6 smp.cmd
n 02 -z 30 -dsr 65 -terr 0.50 -dc 0.006 - 8 x 6 smp.cmd
n 02 -z 30 -dsr 65 -terr 0.50 -dc 0.008 - 8 x 6 smp.cmd

Regards,
Birei
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Grab terms leaving spacings intact

Hi All, I have an input below. I would want to print the 2nd to 5th term leaving the same number of spaces in between each term to be intact. Here in the example, there are 4 spacings between term " ABC " and " 111 ", and i tried the below awk codes but they don;t work. Can anybody give me... (3 Replies)
Discussion started by: Raynon
3 Replies

2. Shell Programming and Scripting

Removing sections and leaving separators intact

I have an awk script like below function abs(val) { return val > 0 ? val : -val } # 1. Main input loop, executed for each line of input BEGIN { RS = ORS = ">" } { if ( NF > 2 ) { if ( abs( $1 - $(NF-2) ) < 40 ) { print } } } The input file is something like... (2 Replies)
Discussion started by: kristinu
2 Replies

3. Shell Programming and Scripting

Help with file editing while keeping file format intact

Hi, I am having a file which is fix length and comma seperated. And I want to replace values for one column. I am reading file line by line in variable $LINE and then replacing the string. Problem is after changing value and writing new file temp5.txt, formating of original file is getting... (8 Replies)
Discussion started by: Mruda
8 Replies

4. UNIX for Dummies Questions & Answers

sort by keeping the headings intact?

Hi all, I have a file with 3 columns separated by space. Each column has a heading. I want to sort according to the values in the 2nd column (ascending order). Ex. Name rank direction goory 0.05 --+ laby 0.0006 --- namy 0.31 -+- ....etc. Output should be Name rank direction laby... (3 Replies)
Discussion started by: Unilearn
3 Replies

5. Shell Programming and Scripting

Need to Zip files three years old or longer but leave folder structure intact

Hi all, Hello everyone, my first post here :). I tried to search the forum but I didn't find exactly what I was looking for... I need to zip/tar files across entire filesystem which are more 3+ years old but leave folder structure intact. If the script locates tar/zip files they are more... (1 Reply)
Discussion started by: sashruby
1 Replies

6. Shell Programming and Scripting

Remove last few characters in a file but keeping Header and trailer intact

Hi All, I am trying write a simple command using AWK and SED to this but without any success. Here is what I am using: head -1 test1.txt>test2.txt|sed '1d;$d' test1.txt|awk '{print substr($0,0,(length($0)-2))}' >>test2.txt|tail -1 test1.txt>>test2.txt Input: Header 1234567 abcdefgh... (2 Replies)
Discussion started by: nvuradi
2 Replies

7. Shell Programming and Scripting

Grab data between 2 keywords any do an array operation and write the file intact

Hi Unix Gurus, I need to grep for a block that is between a start and end keyword and then in between I need to find and replace a keyword. for eg: I need to search between Test = 000; and Test = 000; and find K9 and replace with M9 INPUT FILE Define { Replace = K9; Test =... (6 Replies)
Discussion started by: naveen@
6 Replies

8. Shell Programming and Scripting

Remove duplicates by keeping the order intact

Hello friends, I have a file with duplicate lines. I could eliminate duplicate lines by running sort <file> |uniq >uniq_file and it works fine BUT it changes the order of the entries as it we did "sort". I need to remove duplicates and also need to keep the order/sequence of entries. I... (1 Reply)
Discussion started by: magnus29
1 Replies

9. Shell Programming and Scripting

Printing the output of a gzip command intact

how can i get the printf command or the echo command to print the data that are inbetween the first and the last quotes? #!/bin/sh printf '%s\n' "^_<8b>^H^@U<8c>MX^@^Cí=ÙzÚH<97>×ð^Teìn<8c>Ób_<9d><9f>dXd<9b>^N^F7<82>8qâÎ'^K^Y^T<83>D<90>°M^Lý^Hó^Fs5w3ß|s5/ÐýbS%©<84>^DBH... (4 Replies)
Discussion started by: SkySmart
4 Replies

10. Shell Programming and Scripting

How to control grep output intact for each matching line?

I have multiple (~80) files (some can be as big as 30GB of >1 billion of lines!) to grep on a pattern, and piped the match to a single file. I have a 96-core machine so that each grep job was sent to the background to speed up the search: file1.tab chr1A_part1 123241847 123241848... (6 Replies)
Discussion started by: yifangt
6 Replies
ldi_putmsg(9F)						   Kernel Functions for Drivers 					    ldi_putmsg(9F)

NAME
ldi_putmsg, ldi_getmsg - Read/write message blocks from/to a stream SYNOPSIS
#include <sys/sunldi.h> int ldi_putmsg(ldi_handle_t lh, mblk_t *smp); int ldi_getmsg(ldi_handle_t lh, mblk_t **rmp, timestruc_t *timeo); PARAMETERS
lh Layered handle. smp Message block to send. rmp Message block to receive. timeo Optional timeout for data reception. DESCRIPTION
The ldi_putmsg function allows a caller to send a message block to a streams device specified by the layered handle lh. Once the message (smp) has been passed to ldi_putmsg(), the caller must not free the message even if an error occurs. The ldi_getmsg() function allows a caller to receive a message block from a streams device specified by the layered handle lh. Callers must free the message received with freemsg(9F). If a NULL timeout value is specified when the caller receives a message, the caller sleeps until a message is received. RETURN VALUES
The ldi_putmsg() and ldi_getmsg() functions return 0 upon success. If a failure occurs before the request is passed to the device, the pos- sible return values are shown below. Otherwise any other error number may be returned by the device. EINVAL Invalid input parameters. ENOTSUP Operation is not supported for this device. The ldi_getmsg() function may also return: ETIME Returned if the timeout timeo expires with no messages received. CONTEXT
These functions may be called from user or kernel context. SunOS 5.10 3 June 2003 ldi_putmsg(9F)
All times are GMT -4. The time now is 05:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy