The word "file" is also printed as the shown the output
But, I just need the filepath name
sed 's/^file //; s/ conflict.*$//' <filename>
I think the same as obviously RudiC does: perhaps the empty spaces are not what they seem to be (tabs instead of spaces or the like). Modify your code above to:
to get some additional variability. Notice that the regexp "[[:space:]]*" will cover for tabs (or any other form of whitespace) instead of spaces and the asterisk will make sure that these are completely removed even if there are several (instead of the expected one) of them. i.e. this line:
(notice the multiple spaces) would produce the output:
with leading/trailing blanks without the asterisks.
Hi,
This is my first post here - I'm hoping I can get some help! I have searched these forums and othersand not getting anything that works.
I am trying to extract a single file from a tar archive to a diffierent location than it will default to.
For example my tar log shows me ...
a... (3 Replies)
Sample data:
revision001 | some text | some text
Comment: some comment
Brief: 1) brief
2) brief
------------------------------------------
revision002 | some text | some text
Brief: 1) brief
2) brief
FIX: some fix
------------------------------------------
revision003 | some... (8 Replies)
I have these files in a directory. It may have more class than the sample below:
DEPT_CHEM101LEC_D_20110301.DAT
DEPT_CHEM101LAB_D_20110301.DAT
DEPT_BIO105LEC_D_20110325.DAT
DEPT_BIO105LAB_D_20110325.DAT
DEPT_CSC308LEC_D_20110327.DAT
DEPT_CSC308LAB_D_20110327.DAT
Is there way to extract out... (5 Replies)
Hi I have something like this:
EXAMPLE 1
CREATE UNIQUE INDEX "STRING_1"."STRING_2" ON "BOSNI_CAB_EVENTO"
("CD_EVENTO" , "CD_EJECUCION" ) PCTFREE 10 INITRANS 2 MAXTRANS 255
STORAGE(INITIAL 5242880 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "DB1000_INDICES_512K"... (4 Replies)
I want to extract the proper names with awk from a very long string, like: õ(k): </span><br /><a something="pls/pe/person.person?i_pers_id=3694&i_topic_id=2&i_city_id=3372&i_county_id=-1" target="_blank"><b>Gary Oldman</b></a> (George Smiley)<br /><a... (12 Replies)
I need a script that extracts function names from php files together with their location (path and file in which they are defined).
The php files are located in several directories under a base directory.
Ideally the output should be something like:
"Path/FileName/FunctionName" for a... (2 Replies)
I have the following lines in a log file. It would be great if some one can help me to create a new file with the just entries in the below format.
66.150.161.195 HPSAC=Z05
66.150.161.196 HPSAC=A05
That is just extract the IP address and the string DPSAC=its value
66.150.161.195 -... (1 Reply)
Hi,
Im having some problems with this. I have loaded a file with html code. All code is placed in the same line. I want to get everything between two given strings (including these strings and get only the first appearance).
Example:
File contains <html><body><a href='a.html'>abc</a><a... (5 Replies)
Dear all,
I have a data like below (n of rows=400,000) and I want to extract the rows with certain strings. I use code below. It works if there is not too many strings for example n of strings <5000. while I have 90,000 strings to extract. If I use the egrep code below, I will get error:
... (3 Replies)
I am having the following output when executing a dig command :
dig @1.1.1.1 google.com +noall +answer +stats
; <<>> DiG 9.11.4-P1 <<>> @1.1.1.1 google.com +noall +answer +stats
; (1 server found)
;; global options: +cmd obodrm.prod.at.dmdsdp.com. 86154 IN A ... (1 Reply)
Discussion started by: liviusbr
1 Replies
LEARN ABOUT HPUX
newform
newform(1) General Commands Manual newform(1)NAME
newform - change or reformat a text file
SYNOPSIS
[file]...
DESCRIPTION
reads lines from the named files, or standard input if no input file is named, and reproduces the lines on standard output. Lines are
reformatted in accordance with command line options in effect.
Command line options can appear in any order, can be repeated, and can be intermingled with the optional files. Command line options are
processed in the order specified. This means that option sequences such as yield results different from Options are applied to all files
on the command line.
Options
recognizes the following options:
Same as except characters are appended to the end of a line.
Truncate n characters from the beginning of the line when the line length is greater than the effective line length (see The
default is to truncate the number of characters necessary to obtain the effective line length. The default value is
used when with no n is used. This option can be used to delete the sequence numbers from a COBOL program as follows:
The must be used to set the effective line length shorter than any existing line in the file so that the option is
activated.
Change the prefix/append character to
k. The default character for k is a space.
Same as except that characters are truncated from the end of the line.
Write the tab specification format line on the standard output
before any other lines are output. The tab specification format line which is printed will correspond to the format
specified in the option. If no option is specified, the line which is printed contains the default specification of
Input tab specification:
expands tabs to spaces, according to the tab specifications given. The tabspec recognizes all tab specification
forms described in tabs(1). In addition, tabspec can be in which assumes that the tab specification is to be found
in the first line read from the standard input (see fspec(4)). If no tabspec is given, tabspec defaults to A tabspec
of expects no tabs; if any are found, they are treated as
Set the effective line length to
n characters. If n is not entered, defaults to 72. The default line length without the option is 80 characters.
Note that tabs and backspaces are treated as single characters (use to expand tabs to spaces).
Output tab specification:
replaces spaces with tabs, according to the tab specifications given. The tab specifications are the same as for If
no tabspec is given, tabspec defaults to A tabspec of means that no spaces will be converted to tabs on output.
Prefix n characters (see to the beginning of a line when the line length is less than the effective line length. The
default is to prefix the number of characters necessary to obtain the effective line length.
Shear off leading characters on each line up to the first tab and
place up to 8 of the sheared characters at the end of the line. If more than 8 characters (not counting the first
tab) are sheared, the eighth character is replaced by a and any characters to the right of it are discarded. The
first tab is always discarded.
An error message and program exit occur if this option is used on a file without a tab on each line. The characters
sheared off are saved internally until all other options specified are applied to that line. The characters are then
added at the end of the processed line.
For example, to convert a file with leading digits, one or more tabs, and text on each line, to a file beginning with
the text, all tabs after the first expanded to spaces, padded with spaces out to column 72 (or truncated to column
72), and the leading digits placed starting at column 73, the command would be:
RETURN VALUE
returns one of the following values:
No errors encountered.
An error occurred.
DIAGNOSTICS
All diagnostics are fatal.
was called with a bad option.
There was no tab on one line.
Self-explanatory.
A line exceeds 512 characters
after being expanded in the internal work buffer.
A tab specification is incorrectly formatted,
or specified tab stops are not ascending.
A tabspec read from a file (or standard input) must not contain a tabspec referencing another file (or standard input).
WARNINGS
normally only keeps track of physical characters; however, for the and options, keeps track of backspaces in order to line up tabs in the
appropriate logical columns.
does not prompt the user if a tabspec is to be read from the standard input (by use of or
If the option is used, and the last option specified was and was preceded by either a or a the tab specification format line will be incor-
rect.
SEE ALSO csplit(1), tabs(1), fspec(4).
newform(1)