I have a file which has some lines starting with a particular word. I would like to delete 5 lines before each such line containing that particular word.
eg:
line1
line2
line3
line4
line5
line6
"particular word"...
I would like to delete line2-line6 and all such occurences in that... (4 Replies)
Hi there
I have a file with a variable amount of rows but the 45th, 46th and 47th charachter of each line is the status field which is a three digit code ie 001, 002, 003 etc. My question is this..I need to strip all the records/lines with 002's out of the file completely and put them into... (14 Replies)
When restoring a file in my uninstall program I need to remove the lines I added to a file during the install. In between the file can be modified by the users.
Assume file1 is as follow:
xxx str2 xxxx
.....
...The Following lines containing str* have to be removed...
xxx str1 xxxx
xxx ... (17 Replies)
are there any basic commands that can display lines 99 - 101 of the /etc/passwd file?
I'm thinking use of head and tail, but I forget what numbers to use and where to put /etc/passwd in the command. (2 Replies)
Hello All,
I am new to this forum. I am currently facing a problem in manipulating files.
I have two files called old-matter and new-matter
# cat old-matter
abc: this, is a, sample, entry
byi: white board, is white in color
rtz: black, board is black
qty: i tried, a lot
asd: no... (1 Reply)
Hi,
I have a file named Mani.txt. The contents are like this
cat Mani.txt
--------------------------------------------------------
Hi there how r u
My Name is Mani
Bye
------------------------------------------------------------
I want to cut the first and last lines from the file... (15 Replies)
Hi,
I have a file which contains DDL statements- CREATE TABLE, CREATE INDEX, ALTER TABLE etc.
I have to only pick CREATE TABLE statements from the file-
Source :
----------------------------------------------
--DDL for table abc
--------------------------------------------
CREATE TABLE... (4 Replies)
Hi,
I have one file, say file 1, that has data like below where 19900107 is the date,
19900107 12 144 129 0.7380047
19900108 12 168 129 0.3149017
19900109 12 192 129 3.2766666E-02
... (3 Replies)
This could be a really dummy question.
I have a log text file.
What unix command to extract line from specific string to another specific string.
Is it something similar to?:
more +/"string" file_name
Thanks (4 Replies)
Hello All,
this is my first post so I don't know if I am doing this right.
I would like to append entries from a series of strings (contained in a text file) consecutively at the end of specifically labeled lines in another file.
As an example:
- the file that contains the values to be... (3 Replies)
Discussion started by: gus74
3 Replies
LEARN ABOUT OSF1
realpath
realpath(3) Library Functions Manual realpath(3)NAME
realpath - Resolves pathname
SYNOPSIS
#include <stdlib.h>
char *realpath(
const char *file_name,
char *resolved_name);
STANDARDS
Interfaces documented on this reference page conform to industry standards as follows:
realpath(): POSIX.1, XPG4-UNIX
Refer to the standards(5) reference page for more information about industry standards and associated tags.
DESCRIPTION
The realpath() function derives, from the file pointed to by file_name, an absolute pathname that names the same file, whose resolution
does not involve ".", "..", or symbolic links. The generated pathname is stored, up to a maximum of PATH_MAX bytes, in the buffer pointed
to by resolved_name.
RETURN VALUES
Upon successful completion, the realpath() function returns a pointer to the resolved name. Otherwise, realpath() returns a null pointer
and sets errno to indicate the error, and the contents of the buffer pointed to by resolved_name are undefined.
ERRORS
If the realpath() function fails, errno may be set to one of the following values: Read or search permission was denied for a component of
file_name. Either the file_name or resolved_name argument is a null pointer. An error occurred while reading from the file system. Too
many symbolic links were encountered in resolving path. The file_name argument is longer than PATH_MAX or a pathname component is longer
than NAME_MAX. A component of file_name does not name an existing file or file_name points to an empty string. Insufficient storage space
available. A component of either path prefix is not a directory.
RELATED INFORMATION
Functions: getcwd(3), sysconf(3)
Standards: standards(5) delim off
realpath(3)