Sample input (line feed indicated by )
---------------
The red fox jumped
over the brown fence of the
red hous
He then went into the
orchard
---------------
Desired Output
---------------
The red fox jumped over the brown fence of the red house
He then went into the orchard (11 Replies)
THIS is the output i Get i want to take out most of the banner and such and leave ------ down to ------ with fields right it doesnt seem to ouput right im not sure how to delete the $ characters because shell sees them .....
thansk
or even something that make it looks better to understand... (2 Replies)
Hello,
I'm trying to figure out how to use sed or awk to delete single lines in a file. By single, I mean lines that are not touching any other lines (just one line with white space above and below).
Example:
one
two
three
four
five
six
seven
eight
I want it to look like: (6 Replies)
Sample file:
This is line one,
this is another line,
this is the PRIMARY INDEX line
l ;
This is another line
The command should find the line with “PRIMARY INDEX” and remove the last character from the line preceding it (in this case , comma) and remove the first character from the line... (5 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)
Hi guys!
I use AWK commands under GAMS to predispose the data files to be read by GAMS.
I have a file which contains groups of data I need. Unfortunately I have the data spread in 3 rows for each subject.
Here's an example (the file is really long)
1 0 2.0956 100.00 250.00 100.00 2.0956... (4 Replies)
Dear Unix Forums,
I am hoping you can help me with a pattern matching problem.
What am I trying to do?
I want to replace multiple lines of a text file (that match a multi-line pattern) with a single line of text. These patterns can span several lines and do not always have the same number of... (10 Replies)
I have an awk statement in a ksh script that looks for a certain string then looks at each line after to find another match. The match could be the next line or second down and it works well.
nawk 'BEGIN {FS=RS;RS="!"} /interface loopback0/
{for(i=1;i<=NF; i++) if ($i ~ /ip... (5 Replies)
Hi,
I have been stuck in this requirement where my file contains the below format.
20150812170500846959990854-25383-8.0.0
"ABC Report" hp96880
"4952"
20150812170501846959990854-25383-8.0.0 End of run
20150812060132846959990854-20495-8.0.0
"XYZ Report" vg76452
"1006962188"... (6 Replies)
In the awk piped to sed below I am trying to format file by removing the odd xxxx_digits and whitespace after, then move the even xxxx_digit to the line above it and add a space between them. There may be multiple lines in file but they are in the same format. The Filename_ID line is the last line... (4 Replies)
Discussion started by: cmccabe
4 Replies
LEARN ABOUT DEBIAN
yexpand
YEXPAND(1) General Commands Manual YEXPAND(1)NAME
yexpand - tool to expand environment variables in Nypatchy cradles
SYNOPSIS
yexpand inputfile [ outputfile ]
DESCRIPTION
yexpand is a very simple script to expand environment variables in a text file to their current values in the shell environment. It was
written to be used with nypatchy cradles. It is recommended you not try to use it for any other purposes (note BUGS below).
USAGE
yexpand takes inputfile as input, replaces all instances of shell variables (in the form $VARIABLE or ${VARIABLE}) with their current val-
ues in the environment, and saves the result to outputfile. Undefined variables are replaced with the empty string. If outputfile is not
given, the result is instead saved to the current directory as a file of the same name as inputfile. Thus an input file in the current
directory will be overwritten.
BUGS
This script is very simple-minded. Since it basically just echos its input file as a here-doc, it will attempt to perform all types of
shell substitution (command substitution, etc.) as well as variable substitution. Hence it is likely to fail on anything except the very
simplest text files.
Additionally, this script creates a temporary file. The file is created in the current directory, so there should not be security implica-
tions. However, any existing file named file.yexp (where file is the basename of inputfile) in the current directory will be overwritten
and then deleted.
SEE ALSO fcasplit(1), nycheck(1), nydiff(1), nyindex(1), nylist(1), nymerge(1), nypatchy(1), nyshell(1), nysynopt(1), nytidy(1)
The reference manual for the Nypatchy suite of programs is available in compressed PostScript format at the following URL:
http://wwwasdoc.web.cern.ch/wwwasdoc/psdir/p5refman.ps.gz
AUTHOR
This manual page was written by Kevin McCarty <kmccarty@debian.org> for the Debian GNU/Linux system (but may be used by others). It is
licensed under the GNU General Public License, version 2 or later (at your choice).
COPYRIGHT
Copyright (C) Kevin B. McCarty, 2008.
Mar 12, 2008 YEXPAND(1)