10-27-2011
I have this problem with this row:
sed 's/\(SNAG|\|MARC|\|EA|\|ER|\)/\n\1/g' test3.txt | sed '/^$/d' > test4.txt
SNAG|M1437853| | | | |0001.|0001.|TP02345|2011-03-23|051436.|S
EA|TP02345|2011-03-23-05.14.36.075890|N|50|P/N ON PART 411-42021-513 ,HEADREST COVER,FLT ATTD
Thanks so much
Javier
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
All,
I have a requirement where I will need to split a line into multiple lines.
Ex:
Input:
2ABCDEFGH2POIYUY2ASDGGF2QWERTY
Output:
2ABCDEFGH
2POIYUY
2ASDGGF
2QWERTY
The data is of no fixed lenght. Only the lines have to start with 2.
How can this be done. (5 Replies)
Discussion started by: kingofprussia
5 Replies
2. Shell Programming and Scripting
I am trying to figure out how to split a file when the data in the new line is different from the current line using a shell script?
For eg..
if my input file contains the following
2341123 ABCAD
2341123 ANCAED
2341123 AVADV
3343434 ASDVAV
3343434 ASDFADF
4231232 ADACVAV
4231232... (3 Replies)
Discussion started by: gmatsoon
3 Replies
3. Shell Programming and Scripting
Hi,
I want to split before reading the complete line as the line is very big and its throwing out of memory. can you suggest.
when i say
#cat $inputFile | while read eachLine
and use the eachLine to split its throwing out of memory as the line size is more than 10000000 characters.
Can you... (1 Reply)
Discussion started by: vijaykrc
1 Replies
4. Shell Programming and Scripting
Input file data contents:
>seq_1
MSNQSPPQSQRPGHSHSHSHSHAGLASSTSSHSNPSANASYNLNGPRTGGDQRYRASVDA
>seq_2
AGAAGRGWGRDVTAAASPNPRNGGGRPASDLLSVGNAGGQASFASPETIDRWFEDLQHYE
>seq_3
ATLEEMAAASLDANFKEELSAIEQWFRVLSEAERTAALYSLLQSSTQVQMRFFVTVLQQM
ARADPITALLSPANPGQASMEAQMDAKLAAMGLKSPASPAVRQYARQSLSGDTYLSPHSA... (7 Replies)
Discussion started by: patrick87
7 Replies
5. Shell Programming and Scripting
Dear All,
I want to split single line into two line or three lines wherever “|” separated values comes using
Input line
test,DEMTEMPUT20100404010012,,,,,,,,|0070086|0070087,
output shoule be
test,DEMTEMPUT20100404010012,,,,,,,,0070086,
test,DEMTEMPUT20100404010012,,,,,,,,0070087, (14 Replies)
Discussion started by: arvindng
14 Replies
6. Shell Programming and Scripting
Hi all,
I have logs(in a log file) with the following structure
20100916011501559;0.812;null;TRUE;;FALSE;0.812;0;0;;19
20100916011504762;0.015;null;TRUE;;FALSE;0;4|4;0.015;;4
20100916011504762;0;null;TRUE;;FALSE;0;0;0;;4
20100916011501731;3.343;null;TRUE;;FALSE;3.156;131|65;0.172;;11... (14 Replies)
Discussion started by: babai
14 Replies
7. Shell Programming and Scripting
The requirement is, there is a log file which contains a huge data. i need to get a particular field out of it by searching with another field.
ex:
2011-03-28 13:00:07,423 : millis=231 q={ call get_data_account(?,?,?,?,?) }, params=
i need to search for the word "get_data_account" in file... (1 Reply)
Discussion started by: Jassz
1 Replies
8. Shell Programming and Scripting
HI Guys,
I need to split the file in to number of files . file contains FILEHEADER and EOF . I have to split n number of times . I have to form the file with each splitted message between FILEHEADER and EOF using awk beign and end . how to implement please suggest. (2 Replies)
Discussion started by: manish8484
2 Replies
9. Shell Programming and Scripting
Hi All,
I have file(File1) with data like below:
102100|LName|Gender|Company|Branch|Bday|Salary|Age
102100|bbbb|male|cccc|dddd|19900814|15000|20|
102101|asdg|male|gggg|ksgu|19911216|||
102102|bdbm|male|kkkk|acke|19931018||23|
102102|kfjg|male|kkkc|gkgg|19921213|14000|24|... (2 Replies)
Discussion started by: sarav.shan
2 Replies
10. Shell Programming and Scripting
Hi Gurus,
I have below JSON file, now I want to rewrite this file into a new file.
I will appreciate if anyone can help me to provide the solution...I can't use jq.
{
"_id": "3ad893cb4cf1560add7b4caffd4b6126",
"_rev": "1-1f0ce165e1d210319cf6e9f9c6ff654f",
"name":... (4 Replies)
Discussion started by: manas_ranjan
4 Replies
LEARN ABOUT DEBIAN
marc::crosswalk::dublincore
MARC::Crosswalk::DublinCore(3pm) User Contributed Perl Documentation MARC::Crosswalk::DublinCore(3pm)
NAME
MARC::Crosswalk::DublinCore - Convert data between MARC and Dublin Core
SYNOPSIS
my $crosswalk = MARC::Crosswalk::DublinCore->new;
# Convert a MARC record to Dublin Core (simple)
my $marc = MARC::Record->new_from_usmarc( $blob );
my $dc = $crosswalk->as_dublincore( $marc );
# Convert simple DC to MARC
$marc = $crosswalk->as_marc( $dc );
# Convert MARC to qualified DC instead
$crosswalk->qualified( 1 );
$dc = $crosswalk->as_dublincore( $marc );
DESCRIPTION
This module provides an implentation of the LOC's spec on how to convert metadata between MARC and Dublin Core format. The spec for con-
verting MARC to Dublin Core is available at: http://www.loc.gov/marc/marc2dc.html, and from DC to MARC:
http://www.loc.gov/marc/dccross.html.
NB: The conversion cannot be done in a round-trip manner. i.e. Doing a conversion from MARC to DC, then trying to go back to MARC will not
yield the original record.
INSTALLATION
To install this module via Module::Build:
perl Build.PL
./Build # or `perl Build`
./Build test # or `perl Build test`
./Build install # or `perl Build install`
To install this module via ExtUtils::MakeMaker:
perl Makefile.PL
make
make test
make install
METHODS
new( %options )
Creates a new crosswalk object. You can pass the "qualified" option (true/false) as well.
# DC Simple
$crosswalk = MARC::Crosswalk::DublinCore->new;
# DC Qualified
$crosswalk = MARC::Crosswalk::DublinCore->new( qualified => 1 );
qualified( $qualified )
Allows you to specify if qualified Dublin Core should be used in the input or output. Defaults to false (DC simple).
# DC Simple
$crosswalk->qualified( 0 );
# DC Qualified
$crosswalk->qualified( 1 );
as_dublincore( $marc )
convert a MARC::Record to a DublinCore::Record.
as_marc( $dublincore )
convert a DublinCore::Record to a MARC::Record. NB: Not yet implemented.
TODO
* Implement as_marc()
* add tests
SEE ALSO
* http://www.loc.gov/marc/marc2dc.html
* http://www.loc.gov/marc/dccross.html
* MARC::Record
* DublinCore::Record
AUTHOR
* Brian Cassidy <bricas@cpan.org>
COPYRIGHT AND LICENSE
Copyright 2005 by Brian Cassidy
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.8.8 2007-11-24 MARC::Crosswalk::DublinCore(3pm)