Sponsored Content
Top Forums Shell Programming and Scripting Parsing record into multiple records in Shell Script Post 302371195 by Scott on Friday 13th of November 2009 03:04:44 PM
Old 11-13-2009
Code:
awk 'BEGIN {RS=ORS="|"}
  (NR > 1) && /ADD|MODIFY|DELETE/ { ORS="\n"; print ""; ORS="|" }
  1
' file1

ADD|N000|8015662|
DELETE|N001|9915662|
MODIFY|N999|85678

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Parsing out records from one huge record

Hi, I have one huge record and know that each record in the file is 550 bytes long. How do I parse out individual records from the single huge record. Thanks, (4 Replies)
Discussion started by: bwrynz1
4 Replies

2. UNIX for Advanced & Expert Users

Parsing records from one record

Hi, I got a file which is one huge record. I know each record should be 550 bytes long. How do I parse out the records from the one huge record. (1 Reply)
Discussion started by: bwrynz1
1 Replies

3. Shell Programming and Scripting

Script to display record spanning over multiple lines

Following are the lines from /etc/sudoers.conf bob SPARC = (OP) ALL : SGI = (OP) ALL fred ALL = (DB) NOPASSWD: ALL ALL CDROM = NOPASSWD: /sbin/umount /CDROM,\ /sbin/mount -o nosuid\,nodev /dev/cd0a /CDROM Could you please help me with shell/perl script to display the records with... (2 Replies)
Discussion started by: Ujan
2 Replies

4. Shell Programming and Scripting

Multiple records based on ';' in the record

Hi All, I have a *.csv files in a die /pro/lif/dow, (pipe delimiter file), these files are having 8 columns and 6 column(CDR_LOGIC) records are populated as below, I need to incorporate the below logic in all the *.csv files. 11||:ColumnA||:ColumnB 123||:ColumnA IIF(:ColumnA = :ColumnC then... (6 Replies)
Discussion started by: shruthidwh
6 Replies

5. Shell Programming and Scripting

Split a single record to multiple records & add folder name to each line

Hi Gurus, I need to cut single record in the file(asdf) to multile records based on the number of bytes..(44 characters). So every record will have 44 characters. All the records should be in the same file..to each of these lines I need to add the folder(<date>) name. I have a dir. in which... (20 Replies)
Discussion started by: ram2581
20 Replies

6. UNIX for Dummies Questions & Answers

Split single record to multiple records

Hi Friends, source .... col1,col2,col3 a,b,1;2;3 here colom delimeter is comma(,). here we dont know what is the max length of col3 means now we have 1;2;3 next time i will receive 1;2;3;4;5;etc... required output .............. col1,col2,col3 a,b,1 a,b,2 a,b,3 please give me... (5 Replies)
Discussion started by: bab.galary
5 Replies

7. Shell Programming and Scripting

Splitting record into multiple records by appending values from an input field (AWK)

Hello, For the input file, I am trying to split those records which have multiple values seperated by '|' in the last input field, into multiple records and each record corresponds to the common input fields + one of the value from the last field. I was trying with an example on this forum... (4 Replies)
Discussion started by: imtiaz99
4 Replies

8. Shell Programming and Scripting

Multiple Records from 1 Record

I need to make one record to multiple records based on occurence column in the record and change the date.For example below first record has 5 ,so need to create 5 records from one and change the date to 5 months.Occurence can be any number. I am unable to come with a script.Can some one help ... (5 Replies)
Discussion started by: traininfa
5 Replies

9. Shell Programming and Scripting

Shell script for insert multiple records into a Database

I have a table in an Informix DB into which I want to insert multiple records at a time. Data for one of the column should be unique & other column data may be the same for all the records I insert Typical Insert Statement I use to insert one row : insert into employee(empid, country, state)... (5 Replies)
Discussion started by: nisav
5 Replies

10. Shell Programming and Scripting

How to split one record to multiple records?

Hi, I have one tab delimited file which is having multiple store_ids in first column seprated by pipe.I want to split the file on the basis of store_id(separating 1st record in to 2 records ). I tried some more options like below with using split,awk etc ,But not able to get proper output. can... (1 Reply)
Discussion started by: jaggy
1 Replies
Arch::Changes(3pm)					User Contributed Perl Documentation					Arch::Changes(3pm)

NAME
Arch::Changes - class representing a list of changes SYNOPSIS
use Arch::Changes qw(:type); use Arch::Tree; my $changes = $tree->get_changes; print $changes->get_listing; use Arch::Log; my $changed = $log->get_changes->is_changed('to', "COPYING"); die "License was compromised" if $changed && $changed->{&MODIFY}; DESCRIPTION
Arch::Changes contains a list of elements, each representing a single tree change. Each change element is described by a hash with the following fields: type The type of the change. Can be one of ADD, DELETE, MODIFY, META_MODIFY or RENAME. is_dir A boolean value indicating whether the affected tree element is a directory. arguments A list of arguments. The first element is always relative path of the affected tree element. For changes of type RENAME the first argument is the old path and the second argument the new path name. The type constants can be conveniently imported using the tag ":type". use Arch::Changes qw(:type); METHODS
The following methods are available: new, add, count, get, get_listing, is_changed, dump, type_string, to_string. new Creates a new, initially empty, changes list. Typically it is called indirectly from method get_changes in Arch::Changeset, Arch::Tree or Arch::Log class. add type is_dir arguments... Adds a new change element to the list of changes. Typically it is called indirectly from method get_changes in Arch::Changeset, Arch::Tree or Arch::Log class. count Returns the number of change elements. get num Returns the num-th change element or all if num is undefined. get_listing Generates a textual changes listing as produced by "tla changes". is_changed to filepath [is_dir] Verify whether the given filepath is modified by the changes. The to parameter may get boolean values "0", "1", "from" or "to", it only affects RENAME changes, and in some sense ADD and DELETE changes. If to is set, then the given filepath is taken as the destination of RENAME or ADD, otherwise as the source of RENAME or DELETE. The MODIFY and META_MODIFY changes are not affected, since the destination and the source is the same file/dir. If filepath is not modified by any changes, return undef. Otherwise, return hash with possible keys ADD, DELETE, MODIFY, META_MODIFY and RENAME. The hash values are 1 in all cases except for RENAME, then the value is the file name on the opposite side (i.e., the source of RENAME if to is true, and the destination if false). Note, the valid return values for arch are: undef, hashref with one key (ADD or DELETE) or hashref with combination of one-to-three keys (MODIFY, META_MODIFY and RENAME). dump Generates a dump of the changes list using Data::Dumper. type_string change Returns the change type string as produced by "tla changes". to_string change Generates a changes line for change as produced by "tla changes". BUGS
Awaiting for your reports. AUTHORS
Mikhael Goikhman (migo@homemail.com--Perl-GPL/arch-perl--devel). Enno Cramer (uebergeek@web.de--2003/arch-perl--devel). SEE ALSO
For more information, see tla, Arch::Changeset, Arch::Tree, Arch::Log. perl v5.10.1 2005-10-23 Arch::Changes(3pm)
All times are GMT -4. The time now is 05:14 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy