I have a pipe delimited input file as below. First byte of the each line indicate the record type. Then i need to split the file based on record_type = null,0,1,2,6 and create 5 files. How do i do this in a ksh script? Pls help
|sl||SL|SL|SL|1996/04/03|1988/09/15|C|A|sl||||*|... (4 Replies)
Hi,
I have file with text
________________________________
GROUP:firstname1.lastname1,first_name2.last_name2,first_name3.last_name3
HEAD:firstname.lastname
________________________________
I need help to pick the names separately ie..
Need out put
as
var1 =firstname1.lastname1... (4 Replies)
Hi,
I'm looking for one liner code for counting number of words in a delimited string..
I know about wc -w ..but if i give wc -w a.txt,b.txt it won't work with delimited sting as it was looking for files with a.txt and b.txt
I know there will be a simple solution..i couldn't... (5 Replies)
hello,
i have this string:
variable="1234 /PARAMETER_1:text /PARAMETER_2:othertext"
i tried to do
expr match $variable '.*\(*\)'
but i keep getting expr error
i need to extract the word text...
thank you (4 Replies)
Hi,
I need your help for below with shell scripting or perl
I/P
key, Sentence
customer1, I am David
customer2, I am Taylor
O/P
Key, Words
Customer1,I
Customer1,am
Customer1,David
Customer2,I
Customer2,am
Customer2,Taylor (4 Replies)
I have a unix file text.txt with below content
aaaaa
bbbbbbb
cccccccccc
As of 2013
ddddddddd
eeeeeeeeee
eeeeeeeee
fffffffff
As of 2014
gggggggggggg
hhhhhhhhh
iiiiiiiiiiiiiiii
As of 2016
Now I've to split this file with each file ending with line 'As of' . Please suggest how can I do... (6 Replies)
Hi,
I am wanting to create a script that will construct a SQL statement based on a a space delimited string that it read from a config file.
Example of the SQL will be
For example, it will read a string like "AAA BBB CCC" and assign to a variable named IN_STRING.
I then concatenate... (2 Replies)
I have a large database with the following structure:
Indicword,Indicword,Indicword=English
on a line.
Not all lines will have this structure. Some might have a single word mapping to a single word in Indic.
An example will make this clear
... (4 Replies)
My string variable which gets the output from the result of a database query has values as below:
line="2019-09-11 15:17:55 CR1234 anonymous Deployed DR_only Back_APP"
I wish to construct an array (my_array) which should have entries as below.
Note:
1. The first... (6 Replies)
Discussion started by: mohtashims
6 Replies
LEARN ABOUT MOJAVE
regexp::common::delimited
Regexp::Common::delimited(3) User Contributed Perl Documentation Regexp::Common::delimited(3)NAME
Regexp::Common::delimited -- provides a regex for delimited strings
SYNOPSIS
use Regexp::Common qw /delimited/;
while (<>) {
/$RE{delimited}{-delim=>'"'}/ and print 'a " delimited string';
/$RE{delimited}{-delim=>'/'}/ and print 'a / delimited string';
}
DESCRIPTION
Please consult the manual of Regexp::Common for a general description of the works of this interface.
Do not use this module directly, but load it via Regexp::Common.
$RE{delimited}{-delim}{-esc}
Returns a pattern that matches a single-character-delimited substring, with optional internal escaping of the delimiter.
When "-delim=S" is specified, each character in the sequence S is a possible delimiter. There is no default delimiter, so this flag must
always be specified.
If "-esc=S" is specified, each character in the sequence S is the delimiter for the corresponding character in the "-delim=S" list. The
default escape is backslash.
For example:
$RE{delimited}{-delim=>'"'} # match "a " delimited string"
$RE{delimited}{-delim=>'"'}{-esc=>'"'} # match "a "" delimited string"
$RE{delimited}{-delim=>'/'} # match /a / delimited string/
$RE{delimited}{-delim=>q{'"}} # match "string" or 'string'
Under "-keep" (See Regexp::Common):
$1 captures the entire match
$2 captures the opening delimiter (provided only one delimiter was specified)
$3 captures delimited portion of the string (provided only one delimiter was specified)
$4 captures the closing delimiter (provided only one delimiter was specified)
$RE{quoted}{-esc}
A synonym for $RE{delimited}{q{-delim='"`}{...}}
SEE ALSO
Regexp::Common for a general description of how to use this interface.
AUTHOR
Damian Conway (damian@conway.org)
MAINTAINANCE
This package is maintained by Abigail (regexp-common@abigail.be).
BUGS AND IRRITATIONS
Bound to be plenty.
For a start, there are many common regexes missing. Send them in to regexp-common@abigail.be.
LICENSE and COPYRIGHT
This software is Copyright (c) 2001 - 2009, Damian Conway and Abigail.
This module is free software, and maybe used under any of the following licenses:
1) The Perl Artistic License. See the file COPYRIGHT.AL.
2) The Perl Artistic License 2.0. See the file COPYRIGHT.AL2.
3) The BSD Licence. See the file COPYRIGHT.BSD.
4) The MIT Licence. See the file COPYRIGHT.MIT.
perl v5.18.2 2013-03-08 Regexp::Common::delimited(3)