tene..
first I am Gaurav not Gaorav...
well you would have to look at the regex(especially perl's) to understand what they are.
I will explain in short here
. -> a single character except '\n'
* -> 0 or more occurence of the previous character(s)
^ -> start of the string
$ -> end of the string
if you have perl installed then do
Hi,
My inputfile contains field separaer is ^.
12^inms^
13^fakdks^ssk^s3
23^avsd^
13^fakdks^ssk^a4
I wanted to print only 2 delimiter occurence i.e
12^inms^
23^avsd^ (4 Replies)
Hi,
I have a string say "whateverCluster".
I need everthing apart from the string "Cluster"
Input:
whateverCluster
Desired output:
whatever (5 Replies)
Hi all,
I have a number of strings like below:
//mnt/autocor/43°13'(33")W/
and i'm trying to get the numbers in this string, for example
431333
please help
thanks ahead (14 Replies)
I've a series of words in the format "abc0001d" till "abc1999d".
I would like to use delimiter to cut the word from abc0001s to two words:
abc00 and 01d. Help me in finding the correct delimiter to cut in desired way. (7 Replies)
Hi,
I have a No Delimiter variable length text file with following schema -
Column Name Data length
Firstname 5
Lastname 5
age 3
phoneno1 10
phoneno2 10
phoneno3 10
sample data - ... (16 Replies)
Hi,
I need to find the field separator for the given files.
Ex-
abc.txt is "|" delimited file , when I give command the output should be "|" and that shud store it in another variable.
This is same with csv files or any other delmited file. If I give the filename it shud give the... (1 Reply)
Hi,
Extremely new to Perl scripting, but need a quick fix without using TEXT::CSV
I need to read in a file, pass any delimiter as an argument, and convert it to bar delimited on the output. In addition, enclose fields within double quotes in case of any embedded delimiters.
Any help would... (2 Replies)
Hi,
for fd in $(grep "/tmp/" hello.properties)The grep gives me the below output:
deploydir=/tmp/app1/dfol
prodir= /tmp/hello/prop
......
Now i want to store /tmp/app1/dfol then /tmp/hello/prop in a variable so that i can check if those folders files exists or not.
The delimiter would... (4 Replies)
Hi,
Variable=MKT1,MKT2,MKT3 and so on
i am trying to seperate MKT1,MKT2,MKT3 and store each in a variable.
the values in variable1 may vary. I am using bash (8 Replies)
i have a snippet from server log delimited by forward slash.
/a/b/c/d/filename
i need to cut until last delimiter. So desired output should look like:
/a/b/c/d
can you please help?
Thanks in advance. (7 Replies)
Discussion started by: alpha_1
7 Replies
LEARN ABOUT BSD
strsep
STRSEP(3) Library Functions Manual STRSEP(3)NAME
strsep - separate strings
SYNOPSIS
#include <string.h>
char *
strsep(stringp, delim)
char **stringp;
char *delim;
DESCRIPTION
The strsep() function locates, in the string referenced by *stringp , the first occurrence of any character in the string delim (or the
terminating ` ' character) and replaces it with a ` '. The location of the next character after the delimiter character (or NULL, if the
end of the string was reached) is stored in *stringp . The original value of *stringp is returned.
An ``empty'' field, i.e. one caused by two adjacent delimiter characters, can be detected by comparing the location referenced by the
pointer returned in *stringp to ` '.
If *stringp is initially NULL, strsep() returns NULL.
EXAMPLES
The following uses strsep() to parse a string, containing tokens delimited by white space, into an argument vector:
char **ap, *argv[10], *inputstring;
for (ap = argv; (*ap = strsep(&inputstring, " ")) != NULL;)
if (**ap != '