I'm attempting to insert multiple lines before a line matching a given search pattern. These lines are generated in a separate function and can either be piped in as stdout or read from a temporary file.
I've been able to insert the lines from a file after the pattern using:
sed -i '/pattern/... (2 Replies)
Hello All,
I have a file which is having below type of data,
Jul 19 2011 | 123456
Jul 19 2011 | 123456
Jul 20 2011 | 123456
Jul 20 2011 | 123456
Here I wanted to grep for date pattern as below, so that it should only grep "Jul 20" OR "Jul ... (9 Replies)
Need to remove rest of line after the equals sign on search pattern from the searchfile. Can anybody help. Couldn't find any similar example in the forum:
infile:
64_1535: Delm. = 86 var, aaga
64_1535: Fran. = 57 ex. ccc
64_1639: Feb. = 26 (link). def
64_1817: mar. = 3/4. drz ... (7 Replies)
Hi ,
I have a file which has multiple rows of data, i want to match the pattern for two columns and if both conditions satisfied i have to add the counter by 1 and finally print the count value. How to proceed...
I tried in this way...
awk -F, 'BEGIN {cnt = 0} {if $6 == "VLY278" &&... (6 Replies)
Hi
I know sed and awk has options to give range of line numbers, but
I need to replace pattern in specific lines
Something like
sed -e '1s,14s,26s/pattern/new pattern/' file name
Can somebody help me in this....
I am fine with see/awk/perl
Thank you in advance (9 Replies)
Want to fetch a column with multiple pattern using awk.
How to achieve the same.
Tried
cat test
address : 10.63.20.92/24
address : 10.64.22.93/24
address : 10.53.40.91/24
cat test | awk '{print $3}' |awk -F "/" '{print $1}'
10.63.20.92
10.64.22.93
10.53.40.91
Is there any... (2 Replies)
Hi all,
I am new to using awk and am quickly discovering what a powerful pattern-recognition tool it is. However, I have what seems like a fairly basic task that I just can't figure out how to perform in one line. I want awk to find and print all the lines in which one of multiple patterns (e.g.... (8 Replies)
Hi ,
I have a file where i have modifed certain things compared to original file . The difference of the original file and modified file is as follows.
# diff mir_lex.c.modified mir_lex.c.orig
3209c3209
< if(yy_current_buffer -> yy_is_our_buffer == 0) {
---
>... (5 Replies)
Hi All
I am having one awk and sed requirement for the below problem.
I tried multiple options in my sed or awk and right output is not coming out.
Problem Description
###############################################################
I am having a big file say file having repeated... (4 Replies)
Hello Experts , require help . See below output:
File inputs
------------------------------------------
Server Host = mike
id rl images allocated last updated density
vimages expiration last read <------- STATUS ------->... (4 Replies)
Discussion started by: tigerhills
4 Replies
LEARN ABOUT DEBIAN
business::edi::spec
Business::EDI::Spec(3pm) User Contributed Perl Documentation Business::EDI::Spec(3pm)NAME
Business::EDI::Spec - Object class for CSV-based U.N. EDI specifications
SYNOPSIS
use Business::EDI::Spec;
my $spec = Business::EDI::Spec->new('segment');
DESCRIPTION
CSV files originally from edi4r are included as part of Business::EDI. They are used to define the many different messages, segements,
data elements, composite data elements, and codelists that are part of a given version of the U.N. specification.
The CSV spec files are composed differently for the different structures defined. So we have to parse them differently.
==> Business/EDI/data/edifact/untdid/EDCD.d07a.csv # Composite Elements
CompositeCode;label;pos;code;mandatory;def;[pos;code;mandatory;def;...]
C001;TRANSPORT MEANS;010;8179;C;an..8;020;1131;C;an..17;030;3055;C;an..3;040;8178;C;an..17;
C002;DOCUMENT/MESSAGE NAME;010;1001;C;an..3;020;1131;C;an..17;030;3055;C;an..3;040;1000;C;an..35;
C004;EVENT CATEGORY;010;9637;C;an..3;020;1131;C;an..17;030;3055;C;an..3;040;9636;C;an..70;
C001 => {label => 'TRANSPORT MEANS;010;8179;C;an..8;020;1131;C;an..17;030;3055;C;an..3;040;8178;C;an..17;
==> Business/EDI/data/edifact/untdid/EDED.d07a.csv # Data Elements
code;def;class(?):label
1000;an..35;B;Document name
1001;an..3;C;Document name code
1003;an..6;B;Message type code
1000 => {label => 'an..35;B;Document name
==> Business/EDI/data/edifact/untdid/EDMD.d07a.csv # Messages
MessageCode:x:rel:org:z:SegmentGroup;label;SegCode;mandatory;repeats;[SegCode;mandatory;repeats;...]
APERAK:D:07A:UN::;Application error and acknowledgement message;UNH;M;1;BGM;M;1;DTM;C;9;FTX;C;9;CNT;C;9;SG1;C;99;SG2;C;9;SG3;C;9;SG4;C;99999;UNT;M;1
APERAK:D:07A:UN::SG1;SG01;DOC;M;1;DTM;C;99
APERAK:D:07A:UN::SG2;SG02;RFF;M;1;DTM;C;9
APERAK:D:07A:UN:: => {label => 'Application error and acknowledgement message',
UNH;M;1;
BGM;M;1;
DTM;C;9;FTX;C;9;CNT;C;9;SG1;C;99;SG2;C;9;SG3;C;9;SG4;C;99999;UNT;M;1
==> Business/EDI/data/edifact/untdid/EDSD.d07a.csv # Segments
SegCode;label;pos;code;class;repeats[pos;code;class;repeats;...]
ADR;ADDRESS;010;C817;C;1;020;C090;C;1;030;3164;C;1;040;3251;C;1;050;3207;C;1;060;C819;C;5;070;C517;C;5;
AGR;AGREEMENT IDENTIFICATION;010;C543;C;1;020;9419;C;1;
AJT;ADJUSTMENT DETAILS;010;4465;M;1;020;1082;C;1;
ADR => {label => 'ADDRESS',
010;C817;C;1;020;C090;C;1;030;3164;C;1;040;3251;C;1;050;3207;C;1;060;C819;C;5;070;C517;C;5;
==> Business/EDI/data/edifact/untdid/IDCD.d07a.csv # Composites (interactive)
E001 => {label => 'ADDRESS DETAILS;010;3477;M;an..3;020;3286;M;an..70;030;3286;C;an..70;040;3286;C;an..70;050;3286;C;an..70;060;3286;C;an..70;070;3286;C;an..70;
==> Business/EDI/data/edifact/untdid/IDMD.d07a.csv # Messages (interactive)
MsgCode:x:rel:org:z:SegmentGroup;label;SegCode;mandatory;class;repeats;;[mandatory;class;repeats;...]
IHCEBI:D:07A:UN::;Interactive health insurance eligibility and benefits inquiry and;UIH;M;1;MSD;M;1;SG1;C;9;SG2;C;1;UIT;M;1
IHCEBI:D:07A:UN::SG1;SG01;PRT;M;1;NAA;C;9;CON;C;9;FRM;C;9
IHCEBI:D:07A:UN::SG2;SG02;DTI;M;1;ICI;C;1;FRM;C;9;SG3;C;999
IHCEBI:D:07A:UN::SG3;SG03;BCD;M;1;HDS;C;9;DTI;C;1;PRT;C;9;FRM;C;9
IHCLME:D:07A:UN::;Health care claim or encounter request and response - interactive;UIH;M;1;MSD;C;1;PRT;C;9;NAA;C;9;CON;C;9;BLI;C;1;ITC;C;1;FRM;C;99;SG1;C;3;SG2;C;99;UIT;M;1
IHCLME:D:07A:UN::SG1;SG01;OTI;M;1;NAA;C;2
IHCLME:D:07A:UN::SG2;SG02;PSI;M;1;DNT;C;35
==> Business/EDI/data/edifact/untdid/IDSD.d07a.csv # Segments (interactive)
SegCode;label;pos;code;mandatory;repeats(?)
AAI;ACCOMMODATION ALLOCATION INFORMATION;010;E997;M;20;
ADS;ADDRESS;010;E817;C;1;020;E001;C;1;030;3164;C;1;040;3251;C;1;050;3207;C;1;060;E819;C;1;070;E517;C;1;
AAI => {label => 'ACCOMMODATION ALLOCATION INFORMATION',
pos => '010',
E997;M;20;
TO DO
Parsing for interactive specs.
SEE ALSO
edi4r - http://edi4r.rubyforge.org
Business::EDI
AUTHOR
Joe Atzberger
perl v5.12.4 2010-09-08 Business::EDI::Spec(3pm)