Sponsored Content
Top Forums Programming how to insert and delete characters in the middle of file Post 56667 by mbb on Thursday 7th of October 2004 12:13:56 PM
Old 10-07-2004
If you have the memory, you might want to read the whole file into memory, manipulate it there and then dump the results back to disk.

That could be faster depending on a number of factors e.g number of search operations, insert/delete operations, disk performance or size of file.
 

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
max_async_ports(5)						File Formats Manual						max_async_ports(5)

NAME
max_async_ports - maximum number of asynchronous disk ports that can be open at any time VALUES
Failsafe Default Allowed values Recommended values There is no recommended value for this tunable. The number of processes that will be accessing the driver simultaneously can be used as a guideline to set a value. DESCRIPTION
The asynchronous disk driver provides an interface to execute high-performance I/O to the raw disk. Instead of reading or writing directly to the raw disk, a process writes requests to the asynchronous driver which then makes appropriate calls to the disk driver. Every process that opens the asynchronous disk driver is assigned a port. The driver uses the port to keep track of I/O and other internal resources for that process. The number of opens to the asynchronous disk driver is limited by the number of available ports. Who Is Expected to Change This Tunable? Anyone. Restrictions on Changing Changes to this tunable take effect immediately if the new value is allowed; otherwise the change takes effect at next boot. Increases within the allowed range are always accepted immediately. Decreases in the value may take effect immediately, or may be deferred until next boot depending on the current number of ports in use or the maximum number of ports ever used. When Should the Value of This Tunable Be Raised? When the number of processes opening the driver needs to be more than the current value of the tunable. What Are the Side Effects of Raising the Value of This Tunable? The resources for the port are allocated from the kernel memory. Setting a higher value would result in the driver using slightly more kernel memory. Other kernel components which may need kernel memory could suffer. However, the amount of memory reserved for each port is low. Only when a new port is actually issued does any significant amount of memory get consumed. When Should the Value of This Tunable Be Lowered? There should be no real need to lower the value of the tunable. However, if many processes are opening the async driver and allocating ports, then lowering the value will put a cap on the maximum number of ports that can be allocated and will put a cap on the maximum amount of memory that the driver may allocate. What Are the Side Effects of Lowering the Value of This Tunable? The number of simultaneous opens are limited by this tunable. This may impact the performance of applications that need to have a higher number of processes accessing the driver. What Other Tunables Should Be Changed at the Same Time? None. WARNINGS
All HP-UX kernel tunable parameters are release specific. This parameter may be removed or have its meaning changed in future releases of HP-UX. Installation of optional kernel software, from HP or other vendors, may cause changes to tunable parameter values. After installation, some tunable parameters may no longer be at the default or recommended values. For information about the effects of installation on tun- able values, consult the documentation for the kernel software being installed. For information about optional kernel software that was factory installed on your system, see at AUTHOR
was developed by HP. Tunable Kernel Parameters max_async_ports(5)
All times are GMT -4. The time now is 01:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy