Sponsored Content
Full Discussion: Insert text space
Top Forums Shell Programming and Scripting Insert text space Post 302600384 by balajesuri on Tuesday 21st of February 2012 02:17:33 AM
Old 02-21-2012
1. You want to format it neatly or you want a csv?
2. Here one solution for getting a csv:
Code:
sed "s/^\([0-9]\)/Date \1/; s/Bike speed (kmph)/Bike_speed_(kmph)/; s/ /,/g; s/Bike_speed_(kmph)/Bike speed (kmph)/" input

This User Gave Thanks to balajesuri For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to insert some constant text at beginig of each line within a text file.

Dear Folks :), I am new to UNIX scripting and I do not know how can I insert some text in the first column of a UNIX text file at command promtp. I can do this in vi editor by using this command :g/^/s//BBB_ e,g I have a file named as Test.dat and it containins below text: michal... (4 Replies)
Discussion started by: Muhammad Afzal
4 Replies

2. Shell Programming and Scripting

Need to insert new text and change existing text in a file using SED

Hi all, I need to insert new text and change existing text in a file. For that I used the below line in the command line and got the expected output. sed '$a\ hi... ' shell > shell1 But I face problem when using the same in script. It is throwing the error as, sed: command garbled:... (4 Replies)
Discussion started by: iamgeethuj
4 Replies

3. Shell Programming and Scripting

Insert space between two words

Hi, I need to insert space between words on my output in UNIX other than the single space given by the space bar on my keyboard, e.g when are you going. (There should be 4 spaces between each of these words) rather than when are you going Can anyone help me with... (3 Replies)
Discussion started by: divroro12
3 Replies

4. Shell Programming and Scripting

Insert space between characters using sed

Input: Youcaneasilydothisbyhighlightingyourcode. Putting space after three characters. You can eas ily dot his byh igh lig hti ngy our cod e. How can i do this using sed? (10 Replies)
Discussion started by: cola
10 Replies

5. UNIX for Dummies Questions & Answers

insert white space between numbers

Hello all, I have a file with several lines like this: (1,1) (4,10) (8,23) (17, 4) (6,8) etc. and I need this: ( 1 , 1 ) ( 4 , 10 ) ( 8 , 23 ) ( 17 , 4 ) ( 6 , 8 ) How do I insert a space between the left parenthesis and the first number, between the first number and the comma,... (2 Replies)
Discussion started by: MDeBiasse
2 Replies

6. UNIX for Advanced & Expert Users

Insert 1 space using the command sed

Hi I want to use sed to insert one space after the 10'th character in every line. The lines are on this format: 2012-01-1012:30:55|7323456|65432 2011-02-0313:11:06|1223|3456 ...... ...... Does anyone know sed well enough to acomplish this? If there is any other way around this... (7 Replies)
Discussion started by: ic12
7 Replies

7. Shell Programming and Scripting

how to insert space in alphanumeric string

Hi everyone, I want help to insert space between digits and letters in a alphanumeric string. INPUT TRY234TER PHY1TYR EXPECTED OUTPUT TRY 234 TER PHY 1 TYR The lines always begin with the letters and the alphabets will be a three letter combination before and after the number. The... (2 Replies)
Discussion started by: kaav06
2 Replies

8. UNIX for Dummies Questions & Answers

Changing only the first space to a tab in a space delimited text file

Hi, I have a space delimited text file but I only want to change the first space to a tab and keep the rest of the spaces intact. How do I go about doing that? Thanks! (3 Replies)
Discussion started by: evelibertine
3 Replies

9. Shell Programming and Scripting

How to insert a space and assign the value to another variable?

Hello, I need to insert a space between 2 strings. I used many techniques and all of them worked but when I assign the value to another variable then the inserted space vanishes, strange! Please advise. # dat=`date |awk '{print $2,$3}'` # echo $dat Nov 3 The above is perfectly fine. Now... (4 Replies)
Discussion started by: prvnrk
4 Replies

10. Shell Programming and Scripting

Insert space in a word using sed

Hi all, I have a file that looks like this- ----------------------------- . . ATOM 8 O2' U A 5 135.452 109.687 7.148 1.00 48.99 A16S ATOM 9 C1' U A 5 135.282 111.512 5.641 1.00 48.99 A16S ATOM 10 N1 U A 5 134.647 112.595 ... (2 Replies)
Discussion started by: asmi_g
2 Replies
Tie::RefHash(3pm)					 Perl Programmers Reference Guide					 Tie::RefHash(3pm)

NAME
Tie::RefHash - use references as hash keys SYNOPSIS
require 5.004; use Tie::RefHash; tie HASHVARIABLE, 'Tie::RefHash', LIST; tie HASHVARIABLE, 'Tie::RefHash::Nestable', LIST; untie HASHVARIABLE; DESCRIPTION
This module provides the ability to use references as hash keys if you first "tie" the hash variable to this module. Normally, only the keys of the tied hash itself are preserved as references; to use references as keys in hashes-of-hashes, use Tie::RefHash::Nestable, included as part of Tie::RefHash. It is implemented using the standard perl TIEHASH interface. Please see the "tie" entry in perlfunc(1) and perltie(1) for more information. The Nestable version works by looking for hash references being stored and converting them to tied hashes so that they too can have references as keys. This will happen without warning whenever you store a reference to one of your own hashes in the tied hash. EXAMPLE
use Tie::RefHash; tie %h, 'Tie::RefHash'; $a = []; $b = {}; $c = *main; $d = "gunk"; $e = sub { 'foo' }; %h = ($a => 1, $b => 2, $c => 3, $d => 4, $e => 5); $a->[0] = 'foo'; $b->{foo} = 'bar'; for (keys %h) { print ref($_), " "; } tie %h, 'Tie::RefHash::Nestable'; $h{$a}->{$b} = 1; for (keys %h, keys %{$h{$a}}) { print ref($_), " "; } THREAD SUPPORT
Tie::RefHash fully supports threading using the "CLONE" method. STORABLE SUPPORT
Storable hooks are provided for semantically correct serialization and cloning of tied refhashes. RELIC SUPPORT
This version of Tie::RefHash seems to no longer work with 5.004. This has not been throughly investigated. Patches welcome ;-) MAINTAINER
Yuval Kogman <nothingmuch@woobling.org> AUTHOR
Gurusamy Sarathy gsar@activestate.com 'Nestable' by Ed Avis ed@membled.com SEE ALSO
perl(1), perlfunc(1), perltie(1) perl v5.12.1 2010-04-26 Tie::RefHash(3pm)
All times are GMT -4. The time now is 03:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy