I have the file with the records like
4234234 US phone
3244234 US cup
2342342 CA phone
8947234 US phone
2389472 CA cup
2348972 US maps
3894234 CA phone
I want the records with (US,phone) as record to be in one file, (Us, cup) in another file and (CA,cup) to be in another
I mean all... (12 Replies)
I have gone through all the threads in the forum and tested out different things. I am trying to split a 3GB file into multiple files. Some files are even larger than this.
For example:
split -l 3000000 filename.txt
This is very slow and it splits the file with 3 million records in each... (10 Replies)
hi ,
I have a String str="/opt/ibm/lotus/ibw/latest" or ="/opt/lotus/ibw/latest" this value is dynamic..I want to split this string into 2 strings
1. /opt/ibm/lotus(/opt/lotus) this string must ends with "lotus"
2./ibw/latest
can any body help me on this?
Regards,
sankar (2 Replies)
hi,
I have some problems in my simple script about the redirect echo stdout command inside a condition. Why is the echo command inside the elif still execute in the else command
Here are my simple script
After check on the two diff output the echo stdout redirect is present in two diff... (3 Replies)
Hi all,
I'm pretty new to Shell scripting and I need some help to split a source text file into multiple files. The source has a row with pattern where the file needs to be split, and the pattern row also contains the file name of the destination for that specific piece. Here is an example:
... (2 Replies)
Hi all,
I have a file which I want to split into several files based on a condition. This files has several records. I want one record per file. Each record ends with a //. So, I want to separate files based on this condition. I want split files to be named with the name across the field ID (for... (2 Replies)
Trying to use awk to format the input based on the filed count being 5. Most lines are fine using the awk below, except the first two lines. I know the reason is the -1 in green and -2 in blue. But can not figure out how to not split on the - if it is followed by a digit then letter. Thank you :).... (1 Reply)
Discussion started by: cmccabe
1 Replies
LEARN ABOUT DEBIAN
normalize::text::music_fields
Normalize::Text::Music_Fields(3pm) User Contributed Perl Documentation Normalize::Text::Music_Fields(3pm)NAME
Normalize::Text::Music_Fields - normalize names of people's and (musical) works.
SYNOPSIS
$name = $obj->Normalize::Text::Music_Fields::normalize_person($name);
$work = $obj->Normalize::Text::Music_Fields::normalize_piece($work);
# $obj should have methods `name_for_field_normalization', 'shorted_person'
DESCRIPTION
Databases of names and of works-per-name are taken from plain-text files (optionally in mail-header format). Names are stored in *.lst
files. Works are stored in .comp files named after the shortened name of the composer.
The directories of these files are looked in the environment variable "MUSIC_FIELDS_PATH" (if defined, split the same way as "PATH"), or in
"$ENV{HOME}/.music_fields", and "-" (and "-" is replaced by the directory named as the module file with .pm dropped). At runtime, one can
replace the list by calling function Normalize::Text::Music_Fields::set_path() with the list of directories as the argument.
(Since parsed files are cached, replacing the directory list should be done as early as possible.)
Files may be managed with utility subroutines provided with the module:
# Translate from one-per-line to mail-header format:
perl -wple "BEGIN {print q(# format = mail-header)} s/#s*normalizeds*$//; $_ = qq(Title: $_) unless /^s*(#|$)/; $_ = qq(
$_) if $p and not /^##/; $_ .= qq(
) unless $p = /^##/" Normalize::Text::Music_Fields-G_Gershwin.comp >Music_Fields-G_Gershwin.comp-mail
# (inverse transformation:) Dump pieces listed in mail-header format
perl -MNormalize::Text::Music_Fields -wle "print for Normalize::Text::Music_Fields::read_composer_file(shift, shift)" gershwin Music_Fields-G_Gershwin.comp-mail > o
# Normalize data in 1-line-per piece format
perl -MNormalize::Text::Music_Fields -wle "Normalize::Text::Music_Fields::prepare_tag_object_comp(shift)->Normalize::Text::Music_Fields::normalize_file_lines(shift)"
# Create a mail-header file from a semi-processed (with "bold" fields)
# mail-header file (with xml escapes, preceded by opus number)
perl -MNormalize::Text::Music_Fields -00wnle "BEGIN {$tag = Normalize::Text::Music_Fields::prepare_tag_object_comp(shift @ARGV); print q(# format = mail-header)} print Normalize::Text::Music_Fields::emit_as_mail_header($tag,$_, q(bold,xml,opus),$pre)" shostakovich o-xslt-better >Music_Fields-D_Shostakovich.comp-mail1
# Likewise, from work-per-line with opus-numbers:
perl -MNormalize::Text::Music_Fields -wnle "BEGIN {$tag = Normalize::Text::Music_Fields::prepare_tag_object_comp(shift @ARGV); print qq(# format = mail-header
)} print Normalize::Text::Music_Fields::emit_as_mail_header($tag,$_, q(opus), $pre)" schnittke o-schnittke-better >Music_Fields-A_Schnittke.comp-mail2
# A primitive tool for merging additional info into the database:
perl -MNormalize::Text::Music_Fields -wnle "BEGIN {$tag = Normalize::Text::Music_Fields::prepare_tag_object_comp(shift @ARGV); print qq(# format = mail-header
)} next unless s/^s*++s*//; print Normalize::Text::Music_Fields::merge_info($tag,$_, q(opus,xml), qr(^(58|70|76|116|118|119)($|-)))" brahms o-brahms-op-no1-xslt
# Minimal consistency check of persons database.
perl -MNormalize::Text::Music_Fields -wle "BEGIN{binmode $_, ':encoding(cp866)' for *STDIN, *STDOUT, *STDERR} print Normalize::Text::Music_Fields->check_persons"
# Minimal testing code:
perl -MNormalize::Text::Music_Fields -e Normalize::Text::Music_Fields::test_normalize_piece
It may be easier to type these examples if one uses "manage_M_N_F.pm", which exports the mentioned subroutines to the main namespace
(available in examples directory of a distribution of "MP3::Tag"). E.g., the last example becomes:
perl -Mmanage_M_N_F -e test_normalize_piece
perl v5.14.2 2009-05-08 Normalize::Text::Music_Fields(3pm)