I have a comma delimited file that sometimes has addresses details in. The problem is that the address detail can be seen as:
"Sample House, Sample Road". When I run a script specifying the file is comma delimited I would like it to ignore comma's that are in between speech marks.
Is this... (2 Replies)
Hi,
I am new to unix shell shell scripting. I have a specific requirement where I need to append comma's based on the max number of column in the file.
Eg:
If my source file look something like this,
sengwa,china
tom,america,northamerica
smith,america
walter
My output file... (8 Replies)
Hi All,
I have output of sql saved in comma separated file.
Now i need to read line by line this file
and assign word to a unix variable for further processing
Eg:
Test file
world, 1, 3, 4
earth,2,3,4,5
moon,1,2,3,4
Output should be
word1= world
word2=1
echo " first word... (7 Replies)
Hi this is my first time posting ever. I'm relatively new in using AWK/SED, I've been trying many a solution. I'm trying to replace the 59th column in a file where if I encounter '' then I would like to replace it with the word NULL.
example
0 , '' , '' , 0 , 195.538462
change it to
0... (5 Replies)
How do you delete cells from a space delimited text file given row and column number? Letś say the row number is r and the column number is c. Thanks! (5 Replies)
Hi All,
I need a shell script which could insert a sequence number column inside a dat file(pipe delimited).
I have the dat file similar to the one as shown below..
|A|B|C||D|E
|F|G|H||I|J
|K|L|M||N|O
|P|Q|R||S|T
As shown above, the column 4 is currently blank and i need to insert sequence... (5 Replies)
Hi,
I have a comma (,) delimited file, in which few fields are enclosed with in double quotes " ". I have to print the records in the file which donot have expected number of field with the line number.
File1
====
name,desgnation,doj,project #header#... (7 Replies)
Hi All,
I have a file which has data like
a,b
c,d
e,f
g,h
And I need to insert a new column at the begining with sequence no( 1 to n)
1,a,b
2,c,d
3,e,f
4,g,h
Please let me know how to acheive this in unix (3 Replies)
Hello Everyone..
I want to replace the retail col from FileI with cstp1 col from FileP if the strpno matches in both files
FileP.txt
... (2 Replies)
Discussion started by: YogeshG
2 Replies
LEARN ABOUT OSX
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.16.2 2010-02-23 Regexp::Common::delimited(3)