Sponsored Content
Top Forums Shell Programming and Scripting Insert | in specific position Post 302763333 by srinivas matta on Tuesday 29th of January 2013 11:17:23 PM
Old 01-30-2013
Bob's code is correct. I didnt realize that there are 2 and 4 characters. I thought that all the 3 character separations.

Thanks Bob
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to insert strings at certain position

Hi, I need to insert strings "0000 00" at the each line within the file. The postion is 37 to 42. ex. name1 name2 0000 00 nam name 0000 00 The "0000 00" in two lines should be lined up. I don't know why it's not lined up when I posted it. Can anyone help? (14 Replies)
Discussion started by: whatisthis
14 Replies

2. Shell Programming and Scripting

insert server name in position 1 on each line

Hello, It has been a long time since I have written unix code and I need to insert a variable into the first position of each line in a file. Below is an example of the script and the desired output file Here is my short script server="$(hostname)" df -kg | awk '{print $1, $2, $3, $4,... (3 Replies)
Discussion started by: rlc198842
3 Replies

3. Shell Programming and Scripting

search a line and insert string into specific at position

Hi, guys. I have one question: How can I search for a line with certain string in it and then insert a string into this line? For example: There is a file called shadow, the contents of it are below: ************************** ... yuanz:VIRADxMsadfDF/Q:0:0:50:7:::... (9 Replies)
Discussion started by: daikeyang
9 Replies

4. Shell Programming and Scripting

Insert a text from a specific row into a specific column using SED or AWK

Hi, I am having trouble converting a text file. I have been working for this whole day now, still i couldn't make it. Here is how the text file looks: _______________________________________________________ DEVICE STATUS INFORMATION FOR LOCATION 1: OPER STATES: Disabled E:Enabled ... (5 Replies)
Discussion started by: Issemael
5 Replies

5. Shell Programming and Scripting

Insert character in a specific position of a file

Hi, I need to add Pipe (|) at 5th and 18th position of all records a file. How can I do this? I tried to add it at 5th position using the below code. It didnt work. Please help!!! awk '{substr($0,5,1) ~ /|/}{print}' $input_file > $temp_file (1 Reply)
Discussion started by: gpaulose
1 Replies

6. Shell Programming and Scripting

Using sed to replace specific character and specific position

I am trying to use sed to replace specific characters at a specific position in the file with a different value... can this be done? Example: File: A0199999123 A0199999124 A0199999125 Need to replace 99999 in positions 3-7 with 88888. Any help is appreciated. (5 Replies)
Discussion started by: programmer22
5 Replies

7. Shell Programming and Scripting

insert character in particular position.

I want to insert space in 7th position of all the lines usign vi editor or sed command Input file 12345689010 abcdefghijk . . Output file 123456 89010 abcdef ghijk . . (7 Replies)
Discussion started by: Jairaj
7 Replies

8. Shell Programming and Scripting

substitute a string on a specific position for specific lines

I woud like to substitue a string on a specific position for specific lines I've got a file and I would like to change a specific string from "TOCHANGE" to "ABCABCAB" For every line (except 1,2, 3 and the last one) , I need to check between the 9th and the 16th digits. For the 3rd line, I... (7 Replies)
Discussion started by: BSF
7 Replies

9. Shell Programming and Scripting

How to insert a '#' in the first position of all the files?

Hi All, how to insert a '#' in the first position of all the files based on a certain condition. I tried this: cat /bin/user/input_file.txt | while read a do b=`sed 's/.*song=good.*/\#&/g' $a ` echo $b > /bin/user/new/output_file.txt done input_file.txt has list of names of 10... (5 Replies)
Discussion started by: anand787
5 Replies

10. Shell Programming and Scripting

Insert charactera in 1st position of specific lines using vi editor or sed command

Dear all, i am having text file like below surya rama ranga laxman rajesh reddy i want add string (OK) before a text from line 3 to 5 the result will be surya rama OK ranga OK laxman OK rajesh reddy (1 Reply)
Discussion started by: suryanarayana
1 Replies
BLOBANDCONQUER(6)					    Blob Wars: Blob And Conquer 					 BLOBANDCONQUER(6)

NAME
blobAndConquer - 3D platform shooting game SYNOPSIS
blobAndConquer [OPTION] DESCRIPTION
With the apparent defeat of Galdov and the reclaiming of the Fire, Time, Space and Reality Crystals the Blobs' battle was only just begin- ning. Bob had rescued many Blobs and fought many battles, but now he had an ever bigger task ahead of him. The Blobs' homeworld is still littered with the alien forces and Bob once again makes it his task to lead the counter attack. But even without Galdov the aliens are still extremely well organised... They're Ready. Will You Be? OPTIONS
-fullscreen start the game in full screen mode. -window start the game in windowed mode. -screensize n select size of the game screen. This is a number between 0 and 15, to see which resolution the numbers mean, run blobAndConquer --help. -mono use mono sound output. -stereo use stereo sound output. -noaudio runs the game without sounds and music. -version shows version number and exits. --help displays a summary of command line options to standard output, and exits. MORE INFO
The Blob Wars: Blob And Conquer gameplay manual can be found in </usr/share/doc/blobandconquer/index.html>. AUTHOR
Written by Stephen Sweeney <stephen.j.sweeney@gmail.com>. This manual page was written by Guus Sliepen <guus@debian.org>, for the Debian project (but may be used by others). blobAndConquer April 2006 BLOBANDCONQUER(6)
All times are GMT -4. The time now is 08:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy