I want to write a script which will check the arguments and if there is a single space(if 2 more more space in a row , then do not touch), replace it with _ and then gather the argument
so, program will be ran
./programname hi hello hi usa now hello hello
so, inside of program,... (7 Replies)
I'm reading from a file that is semi-colon delimited. One of the fields contains 2 spaces separating the first and last name (4th field in - "JOHN<space><space> DOE"):
e.g. TORONTO;ONTARIO;1 YONGE STREET;JOHN DOE;CANADA
When I read this record and either echo/print to screen or write to... (4 Replies)
I am searching while I await a response to this so if it has been asked already I apologize.
I have a file with lines in it that look like:
bob johnson email@email.org
I need it to look like:
bob:johnson:email@email.org
I am trying to use sed like this:
sed -e 's/ /:/g' file >... (5 Replies)
Hi all,
Is there a way to perform the above, I am trying to strip out more than one space from a line, but keep the single space. See below output example.
My Name is test test2 test3 test4 test5
My Name is test test2 test3 test4 test5
Please note that the lines would contain... (7 Replies)
consider the small piece of code
while read line
do
echo $line
done < example
content of example file
sadasdasdasdsa erwerewrwr ergdgdfgf rgerg erwererwr
the output is like
sadasdasdasdsa erwerewrwr ergdgdfgf rgerg erwererwr
the... (4 Replies)
I am trying to read a txt file and trying to translate multiples spaces into single spaces so the file is more organized, but whenever I try the command:
tr ' ' ' ' w.txt
The output is:
tr: extra operand `w.txt'
Try `tr --help' for more information.
Can someone please help? :wall:
... (2 Replies)
Platform : RHEL 5.8
I want to end each line of this file with a single quote.
$ cat hello.txt
blueskies
minnie
mickey
gravity
snoopyAt VI editor's command mode, I have used the following command to replace the last character with a single quote.
~
~
~
:%s/$/'/gNow, the lines in the... (10 Replies)
From:
1,2,3,4,5,This is a test
6,7,8,9,0,"This, is a test"
1,9,2,8,3,"This is a ""test"""
4,7,3,1,8,""""
To:
1,2,3,4,5,This is a test
6,7,8,9,0,"This; is a test"
1,9,2,8,3,"This is a ''test''"
4,7,3,1,8,"''"Is there an easy syntax I'm overlooking? There will always be an odd number... (5 Replies)
Hi All.
Attached are two files.
I ran a query and have the output as in the file with name "FILEWITHFOURRECORDS.txt "
I didn't want all the spaces between the columns so I squeezed the spaces with the "tr" command and also added a carriage return at the end of every line.
But in two... (3 Replies)
Hi I want to read a text file and replace various number of spaces between each string in to a single "," or any other character .Please let me know the command to do so. My input file is a txt file which is the output of a SQL table extract so it contains so many spaces between each column of the... (2 Replies)
Discussion started by: Hari Prasanth
2 Replies
LEARN ABOUT NETBSD
vgrindefs
VGRINDEFS(5) BSD File Formats Manual VGRINDEFS(5)NAME
vgrindefs -- language definition data base for vgrind(1)SYNOPSIS
vgrindefs
DESCRIPTION
The vgrindefs file contains all language definitions for vgrind(1). The data base is very similar to termcap(5).
FIELDS
The following table names and describes each field.
Name Type Description
pb str regular expression for start of a procedure
bb str regular expression for start of a lexical block
be str regular expression for the end of a lexical block
cb str regular expression for the start of a comment
ce str regular expression for the end of a comment
sb str regular expression for the start of a string
se str regular expression for the end of a string
lb str regular expression for the start of a character constant
le str regular expression for the end of a character constant
tl bool present means procedures are only defined at the top lexical level
oc bool present means upper and lower case are equivalent
kw str a list of keywords separated by spaces
EXAMPLES
The following entry, which describes the C language, is typical of a language entry.
C|c::pb=^d?*?d?pd?(a?):bb={:be=}:cb=/*:ce=*/:sb=":se=e":
:lb=':le=e':tl:
:kw=asm auto break case char continue default do double else enum
extern float for fortran goto if int long register return short
sizeof static struct switch typedef union unsigned while #define
#else #endif #if #ifdef #ifndef #include #undef # define else endif
if ifdef ifndef include undef:
Note that the first field is just the language name (and any variants of it). Thus the C language could be specified to vgrind(1) as "c" or
"C".
Entries may continue onto multiple lines by giving a as the last character of a line. Capabilities in vgrindefs are of two types: Boolean
capabilities which indicate that the language has some particular feature and string capabilities which give a regular expression or keyword
list.
REGULAR EXPRESSIONS
vgrindefs uses regular expression which are very similar to those of ex(1) and lex(1). The characters `^', `$', `:' and `' are reserved
characters and must be "quoted" with a preceding '' if they are to be included as normal characters. The metasymbols and their meanings
are:
$ the end of a line
^ the beginning of a line
d a delimiter (space, tab, newline, start of line)
a matches any string of symbols (like .* in lex)
p matches any alphanumeric name. In a procedure definition (pb) the string that matches this symbol is used as the procedure name.
() grouping
| alternation
? last item is optional
e preceding any string means that the string will not match an input string if the input string is preceded by an escape character ().
This is typically used for languages (like C) which can include the string delimiter in a string by escaping it.
Unlike other regular expressions in the system, these match words and not characters. Hence something like "(tramp|steamer)flies?" would
match "tramp", "steamer", "trampflies", or "steamerflies".
KEYWORD LIST
The keyword list is just a list of keywords in the language separated by spaces. If the "oc" boolean is specified, indicating that upper and
lower case are equivalent, then all the keywords should be specified in lower case.
FILES
/usr/share/misc/vgrindefs File containing terminal descriptions.
SEE ALSO troff(1), vgrind(1)HISTORY
The vgrindefs file format appeared in 4.2BSD.
BSD June 6, 1993 BSD