06-19-2008
script help needed --- awk?
hello and thanks in advance.
I need to consolidate 2 records of data into 1 record.
here is a sample of the input:
------------------------------------------------------------------------------------------
totalcount fred thomas 99999.00 88888:00
total 77777.00
------------------------------------------------------------------------------------------
totalcount sally smither 99999.00 88888:00
total 77777.00 66666.00
------------------------------------------------------------------------------------------
Sample records are grouped within the '-------'. I need the data within the '---------' consolidated to look like the output format below
Fred, Thomas, 77777.00, 99999.00, 888888:00
Sally, Smither, 77777.00, 99999.00, 888888:00
Last edited by scuderiaf1; 06-21-2008 at 10:44 AM..
Reason: simplified the sample data
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a shell script which reads a file named filelist.txt, containing a list of fully qualified filenames (with complete path), and then does some processing based on the file extension. In order to do the processing, I have to know the file extension, the filename without extension and just the... (3 Replies)
Discussion started by: inditopgun
3 Replies
2. Shell Programming and Scripting
Hi, i am not able to get an approach for converting xml file to flat file using awk programming. Can anyone help me out.
The input xml is like this:
<outer>
<field1>one</field1>
<field2>two</field2>
<field3>three<Error Code=777 Description=12345/></field3>
<field4>four</field4>
</outer>... (2 Replies)
Discussion started by: naren_0101bits
2 Replies
3. Shell Programming and Scripting
hi,
firstly, thank you all for helping me in previous posts. Here,I have a script with awk and a problem with in it as given below
*********************************
parameter1=" $1"
parameter2 = "$2"
$script1 "parameter1" "parameter2" |\
{ awk '{ .....
END{
... (6 Replies)
Discussion started by: rider29
6 Replies
4. UNIX for Dummies Questions & Answers
I have to add number in column 1 by month.
1531 Feb 1 2007 pgaps_p007_27909.trc
1529 Feb 1 2007 pgaps_p006_27907.trc
1533 Feb 1 2007 pgaps_p005_27905.trc
635 Apr 7 2007 pgaps_smon_2347.trc
634 Apr 7 2007 pgaps_lgwr_2343.trc
634 Apr 8 2007 pgaps_lgwr_2311.trc
613 Apr 10 2007... (4 Replies)
Discussion started by: findprakash
4 Replies
5. Shell Programming and Scripting
How do I alter this command so that it prints only the second comma delimited field from line number 3? Secondly, how do you redirect the output to a variable called TEST?
Thanks
(cat BATCH007.TXT | awk 'BEGIN { FS = "," } ; {print $2 }') (5 Replies)
Discussion started by: ddurden7
5 Replies
6. Shell Programming and Scripting
hi,
I have input file woth records as shown below
OCSMRC_OK,7057348733,+0.00,0,18/05/2010 23:42:19,BellMobility,302610000918553,0006056099,B30,686505,686505,OCS_MRC,+49.14,0,0
,0,0,
OCSPPKB_NOK,4163460120,+1.25,0,18/05/2010... (4 Replies)
Discussion started by: raghavendra.cse
4 Replies
7. UNIX for Dummies Questions & Answers
I have a source file (sample below) that I'm trying to standarize into a text file with pipe delimited currently I'm looking at the file as space delimited....
:wall: I have one issue that I don't know how to handle - in the second set of " " is a filename along with the path - most cases that... (2 Replies)
Discussion started by: DebDor
2 Replies
8. Shell Programming and Scripting
Hi,
i have input records as shown below.
4097,Probe3,G10,255,05/17/2011 12:44:03:185,NULL,05/17/2011 12:39:03:180,05/17/2011... (1 Reply)
Discussion started by: raghavendra.nsn
1 Replies
9. Shell Programming and Scripting
but I'm stumped...please help
I have a file like this.......
1000 1 34
1000 10 34
1000 11 35
1000 20 35
1000 21 36
1000 30 36
2000 1 34
2000 10 34
which I would like printed out as 40 lines
1000 1 34
1000 2 34
1000 3 34
1000 4 ... (2 Replies)
Discussion started by: garethsays
2 Replies
10. Shell Programming and Scripting
Hi..
have a file as below, appreciate if someone can help on this
143|500| 10| 23353 22131 23355 23354 23358 23352 23357 23350 23349 23351| RAID5
213|1008| 9| 22419 22412 221 22413 22414 22416 22417 22415 22418| RAID6
1088|500| 5| 22243 22240 22244 22242 22241| RAID5
322|1200| 12|... (6 Replies)
Discussion started by: richard0@rediff
6 Replies
LEARN ABOUT DEBIAN
marc::file::microlif
MARC::File::MicroLIF(3pm) User Contributed Perl Documentation MARC::File::MicroLIF(3pm)
NAME
MARC::File::MicroLIF - MicroLIF-specific file handling
SYNOPSIS
use MARC::File::MicroLIF;
my $file = MARC::File::MicroLIF->in( $filename );
while ( my $marc = $file->next() ) {
# Do something
}
$file->close();
undef $file;
EXPORT
None.
The buffer must be large enough to handle any valid record because we don't check for cases like a CR/LF pair or an end-of-record/CR/LF
trio being only partially in the buffer.
The max valid record is the max MARC record size(99999) plus one or two characters per tag (CR, LF, or CR/LF). It's hard to say what the
max number of tags is, so here we use 6000. (6000 tags can be squeezed into a MARC record only if every tag has only one subfield
containing a maximum of one character, or if data from multiple tags overlaps in the MARC record body. We're pretty safe.)
METHODS
in()
Opens a MicroLIF file for reading.
Gets the next chunk of data. If $want_line is true then you get the next chunk ending with any combination of
and
of any length. If
it is false or not passed then you get the next chunk ending with x60 followed by any combination of
and
of any length.
All trailing
and
are stripped.
header()
If the MicroLIF file has a file header then the header is returned. If the file has no header or the file has not yet been opened then
"undef" is returned.
decode()
Decodes a MicroLIF record and returns a USMARC record.
Can be called in one of three different ways:
$object->decode( $lif )
MARC::File::MicroLIF->decode( $lif )
MARC::File::MicroLIF::decode( $lif )
TODO
RELATED MODULES
MARC::File
LICENSE
This code may be distributed under the same terms as Perl itself.
Please note that these modules are not products of or supported by the employers of the various contributors to the code.
AUTHOR
Andy Lester, "<andy@petdance.com>"
perl v5.10.1 2010-03-29 MARC::File::MicroLIF(3pm)