Hi, excuse me for my poor english.
My problem is that:
I have a File
i want to add to each line of that file two strings: one at the beginning of the line, one at the ending.
string1="abcd"
string2="efgh"
i want $string1 content $string2 for each line.
Is that possible? (3 Replies)
I have a file with varying record length in it. I need to reformat this file so that each line will have a length of 100 characters (99 characters + the line feed).
AU * A01 EXPENSE 6990370000 CWF SUBC TRAVEL & MISC
MY * A02 RESALE 6990788000 Y... (3 Replies)
Hi all,
using VI, can anyone tell me how to add some characters onto the end of a line where the line begins with certain charactars eg
a,b,c,.......,
r,s,t,........,
a,b,c,.......,
all lines in the above example starting with a,b,c, I want to add an x at the end of the line so the... (6 Replies)
What is a regex for "the dalai lama, his holiness the"
that would just grab "the dalai lama"
and one that would just grab "his holiness the"? Both should exclude the comma..
I was trying '^.*' and many variants with no luck. (6 Replies)
Well here goes:
I tried to write a batch file that adds a specific fixed text to each line of an already existing text file.
for the adding text infront of each line I tried this:
for /F "delims=" %%j in (list.txt) do echo.STARTTEXT\%%j >> list.txt
for adding text after each line I... (0 Replies)
How would you do vim copy line and paste at the beginning, middle, and end of another line. I know yy copies the whole line and p pastes the whole line, but on its own separate line. Sometimes I would like to copy a line to the beginning, middle, or end of another line. I would think this would be... (3 Replies)
I have been trying to insert a line after a regex but I can't do it. Here is the code I am using:
cat saved_doc
SET type = type1
SET type = STORE = y
/vol/san_e1
/vol/san_5
/vol/san_e9
/vol/san_e11
/vol/san_e12
/vol/san_e13
/vol/san_e14
/vol/san_e16
/vol/san_e17
/vol/san_e18... (4 Replies)
Hi,
I have a specific requirement to add text at the beginning and end of a plain text file. I tried to use "sed" with '1i' and '$a' flags but these required two separate "sed" commands separated with "|".
I am looking for some command/option to join these two in single command parameter.
... (6 Replies)
I would like to insert n number of characters at the beginning of each line that starts with a given character. If possible, I would be most appreciative for a sed or awk solution.
Given the data below, I would like to be able to insert either 125 spaces or 125 "-" at the beginning of every line... (6 Replies)
Discussion started by: jvoot
6 Replies
LEARN ABOUT SUNOS
regex
regex.h(3HEAD) Headers regex.h(3HEAD)NAME
regex.h, regex - regular expression matching types
SYNOPSIS
#include <regex.h>
DESCRIPTION
The <regex.h> header defines the structures and symbolic constants used by the regcomp(), regexec(), regerror(), and regfree() functions.
See regcomp(3C).
The structure type regex_t contains the following member:
size_t re_nsub number of parenthesized subexpressions
The type size_t is defined as described in <sys/types.h>. See types.h(3HEAD).
The type regoff_t is defined as a signed integer type that can hold the largest value that can be stored in either a type off_t or type
ssize_t. The structure type regmatch_t contains the following members:
regoff_t rm_so byte offset from start of string to start of substring
regoff_t rm_eo byte offset from start of string of the first character after the end
of substring
Values for the cflags parameter to the regcomp function are as follows:
REG_EXTENDED use extended regular expressions
REG_ICASE ignore case in match
REG_NOSUB report only success or fail in regexec()
REG_NEWLINE change the handling of NEWLINE character
Values for the eflags parameter to the regexec() function are as follows:
REG_NOTBOL The circumflex character (^), when taken as a special character, does not match the beginning of string.
REG_NOTEOL The dollar sign ($), when taken as a special character, does not match the end of string.
The following constants are defined as error return values:
REG_NOMATCH regexec() failed to match.
REG_BADPAT Invalid regular expression.
REG_ECOLLATE Invalid collating element referenced.
REG_ECTYPE Invalid character class type referenced.
REG_EESCAPE Trailing '' in pattern.
REG_ESUBREG Number in fIdigit invalid or in error.
REG_EBRACK "[]" imbalance.
REG_EPAREN "()" or "()" imbalance.
REG_EBRACE "" imbalance.
REG_BADBR Content of "" invalid: not a number, number too large, more than two numbers, first larger than second.
REG_ERANGE Invalid endpoint in range expression.
REG_ESPACE Out of memory.
REG_BADRPT '?', '*', or '+' not preceded by valid regular expression.
REG_ENOSYS Reserved.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
SEE ALSO regcomp(3C), types.h(3HEAD), attributes(5), standards(5)SunOS 5.10 9 Sep 2004 regex.h(3HEAD)