Hi
I want to delete first five and last five lines in text files without opening the file and also i want to keep the same file name for all the files.
Thanks in advance!!!
Ragav (10 Replies)
Hi all,
I am trying to replace a few lines with other lines of all files in a directory which contain those few lines.
say - there are some 10 files in a dir having the same 4 lines as 1.txt at the starting
1.txt
line 1
line 2
line 3
line 4
....................................... (1 Reply)
I just created a file in vi, looks like this:
Hello nobody
nobody
What I need is to have sed change the file so it looks like this:
Hello everybody
In other words, the sed query needs to look for both instances of "nobody" before it puts the word "everybody" on the first line. ... (2 Replies)
Dear All,
Regards of the Day.
I have a text file with some functions:
Function1
{
parameter 1
parameter 2
parameter 3
}
end
Function2
{
parameter 1
parameter 2
parameter 3
} (1 Reply)
Hello Masters,
I have two subtitles file with different language like below
First file :
1
00:00:41,136 --> 00:00:43,900
2
00:00:55,383 --> 00:00:58,477
<i> Ladies and gentlemen,</i>
<i>this is Simon Barsinister,</i>
3
00:00:58,553 --> 00:01:00,521
<i>the wickedest man in the... (8 Replies)
Dear Experts,
I am new to unix shell programming. I need to write a script which needs to edit 4 text files.
File 1:- PCH_Test.txt
File 2:- PCT_Test.txt
File 3:- PCY_Test.txt
File 4:- PCW_Test.txt
PCH_Test.txt
First it needs to get into PCH_Test file and prefix the 6th coloumn... (2 Replies)
Well, to make another post at this helpful forum :b::D:
I recently tried something like this, I want to replace all those numberings/letters that are located
between <string>file://localhost/var/mobile/Applications/ and /Documents/</string>
numberings =----
replace with:
first... (6 Replies)
Hi friends,
This is sed & awk type question.
I have a text file which has numbers spread all over the file. I want to sum the series of numbers whenever i find it and produce an output file with the sum. For example
###start of input text file ####
abc
def
ghi
1
2
3
4
kjld
random... (3 Replies)
Hallo Everyone.
I have to admit I'm shell scripting illiterate . I need to find certain strings in several text files and replace each of the string by unique & corresponding text.
I prepared a csv file with 3 columns: <filename>;<old_pattern>;<new_pattern>
... (5 Replies)
I dont even have a sample script cause I dont know where to start from. My data lookes like this
> sat#16 #data: 15 site:UNZA baseline: 205.9151
0.008 -165.2465 35.8109 40.6685 21.9148 121.1446 26.4629 -18.4976 33.8722
0.017 -165.2243 48.2201 40.6908 ... (8 Replies)
Discussion started by: malandisa
8 Replies
LEARN ABOUT CENTOS
binsrch
BINSRCH(3) WordNettm Library Functions BINSRCH(3)NAME
bin_search, copyfile, replace_line, insert_line - general purpose functions for performing a binary search
SYNOPSIS
char *bin_search(char *key, FILE *fp);
void copyfile(FILE *fromfp, FILE *tofp);
char *replace_line(char *new_line, char *key, FILE *fp);
char *insert_line(char *new_line, char *key, FILE *fp);
DESCRIPTION
The WordNet library contains several general purpose functions for performing a binary search and modifying sorted files.
bin_search() is the primary binary search algorithm to search for key as the first item on a line in the file pointed to by fp. The delim-
iter between the key and the rest of the fields on the line, if any, must be a space. A pointer to a static variable containing the entire
line is returned. NULL is returned if a match is not found.
The remaining functions are not used by WordNet, and are only briefly described.
copyfile() copies the contents of one file to another.
replace_line() replaces a line in a file having searchkey key with the contents of new_line. It returns the original line or NULL in case
of error.
insert_line() finds the proper place to insert the contents of new_line, having searchkey key in the sorted file pointed to by fp. It
returns NULL if a line with this searchkey is already in the file.
NOTES
The maximum length of key is 1024.
The maximum line length in a file is 25K.
If there are no additional fields after the search key, the key must be followed by at least one space before the newline character.
SEE ALSO wnintro(3), morph(3), wnsearch(3), wnutil(3), wnintro(5).
WARNINGS
binsearch() returns a pointer to a static character buffer. The returned string should be copied by the caller if the results need to be
saved, as a subsequent call will replace the contents of the static buffer.
WordNet 3.0 Dec 2006 BINSRCH(3)