Sponsored Content
Top Forums Programming how to insert and delete characters in the middle of file Post 56557 by jim mcnamara on Tuesday 5th of October 2004 02:23:03 PM
Old 10-05-2004
Driver gave you the clever efficient way. Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk insert character in the middle of a line

I'm trying to insert a single character at position 11 in everyline of a file. My input file looks like this: 456781 ~Y~12345 456782 ~N~12300 and I want my output to look like this: 45678~1 ~Y~12345 45678~2 ~N~12300 I tried the following awk code, but it's not working:... (3 Replies)
Discussion started by: mmarino
3 Replies

2. Shell Programming and Scripting

insert text into the middle of a original file

how do u insert text into a specific place in a file, say the middle for example, without changing the name for that file (1 Reply)
Discussion started by: mopimp
1 Replies

3. Shell Programming and Scripting

How to insert text into first line of the file and middle of the file?

Script 1 Pre-requisites Create a file with x amount of lines in it, the content of your choice. Write a script that takes two arguments. The first being a line of text, the second being your newly created file. The script should take the first argument and insert it into the very top (the... (3 Replies)
Discussion started by: ali hussain
3 Replies

4. Shell Programming and Scripting

How to insert the 1st arg into the middle of the file

I wrote a script like #!/bin/bash echo $1 > temp cat $2 >> temp mv temp $2 now I have problem appending the above script(only using bash shell) so that it now inserts the first argument into the middle of the file. I have tried using $(('wc -l < file' / 2 )) but invain so could any one... (4 Replies)
Discussion started by: boris
4 Replies

5. Shell Programming and Scripting

insert one file into middle of another file

how to insert one file into another file not by concatenating as usual done. file1 A B C D E F G H I J K L file2 23455 33444 33334 33345 Output shud be 23455 A B C D (4 Replies)
Discussion started by: cdfd123
4 Replies

6. Shell Programming and Scripting

insert text in the middle of a file

I want to insert a text into the middle of a file (3 Replies)
Discussion started by: relle
3 Replies

7. UNIX for Dummies Questions & Answers

How to insert text in the middle of a file

Hey guys, how do we take a line of text as an argument from a user and then insert it in the middle of a file irrespective of the number of lines in the file. I am trying to do this without SED or AWK. Inserting it in the beginning and at the end is easy, but i am trying to accomplish inserting... (6 Replies)
Discussion started by: kartikkumar84@g
6 Replies

8. Shell Programming and Scripting

How do I insert a line in the middle of a file in BASH?

I have tried sed '/6/a text_to_inserted' file > newfile but this inserts test_to_insert at random places in file and i want it in specific location, which is line 6. can anyone help.... (6 Replies)
Discussion started by: phenom
6 Replies

9. Shell Programming and Scripting

How to insert text in the middle of a file?

Hi, So far i've made a script that takes two argument, 1st is the contents and the 2nd is the named file. At the moment i've managed to insert new contents as a new line at the top, but i want to ask how can you insert contents in the middle of the file? Source Code #!/bin/bash #Write... (3 Replies)
Discussion started by: zen10
3 Replies

10. Shell Programming and Scripting

delete blank line from middle of a file

All, I have a file which contains two entry with spaces (either one or more than one space). ex. /tmp/scripts/sql CUST_YR_END_INI.sql /tmp/scripts/sql CUST_WK_END_INI.sql /tmp/scripts/sql CUST_MTH_END_INI.sql /tmp/scripts/sql CUST_YR_END_INC.sql now I want to... (11 Replies)
Discussion started by: anshu ranjan
11 Replies
POE::Driver::SysRW(3pm) 				User Contributed Perl Documentation				   POE::Driver::SysRW(3pm)

NAME
POE::Driver::SysRW - buffered, non-blocking I/O using sysread and syswrite SYNOPSIS
"SYNOPSIS" in POE::Driver illustrates how the interface works. This module is merely one implementation. DESCRIPTION
This driver implements POE::Driver using sysread and syswrite. PUBLIC METHODS
POE::Driver::SysRW introduces some additional features not covered in the base interface. new [BlockSize => OCTETS] new() creates a new buffered I/O driver that uses sysread() to read data from a handle and syswrite() to flush data to that handle. The constructor accepts one optional named parameter, "BlockSize", which indicates the maximum number of OCTETS that will be read at one time. "BlockSize" is 64 kilobytes (65536 octets) by default. Higher values may improve performance in streaming applications, but the trade-off is a lower event granularity and increased resident memory usage. Lower "BlockSize" values reduce memory consumption somewhat with corresponding throughput penalties. my $driver = POE::Driver::SysRW->new; my $driver = POE::Driver::SysRW->new( BlockSize => $block_size ); Drivers are commonly instantiated within POE::Wheel constructor calls: $_[HEAP]{wheel} = POE::Wheel::ReadWrite->new( InputHandle => *STDIN, OutputHandle => *STDOUT, Driver => POE::Driver::SysRW->new(), Filter => POE::Filter::Line->new(), ); Applications almost always use POE::Driver::SysRW, so POE::Wheel objects almost always will create their own if no Driver is specified. All Other Methods POE::Driver::SysRW documents the abstract interface documented in POE::Driver. Please see POE::Driver for more details about the following methods: flush get get_out_messages_buffered put SEE ALSO
POE::Driver, POE::Wheel. Also see the SEE ALSO section of POE, which contains a brief roadmap of POE's documentation. AUTHORS &; COPYRIGHTS Please see POE for more information about authors and contributors. perl v5.14.2 2012-05-15 POE::Driver::SysRW(3pm)
All times are GMT -4. The time now is 09:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy