07-14-2015
Hi,
Could you please let me know how to direct output files created in above awk (Post from Don) to different Directory?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi there,
I need to split one huge file into separate files if the condition is fulfilled according to that the position between 97 and 98 matches with “IT” at the segment MAS. There is no delimiter file is fix-width with varous line length.
Could you please help me how I do split the file... (1 Reply)
Discussion started by: ozgurgul
1 Replies
2. UNIX for Dummies Questions & Answers
All,
We receive a file with a large no of records (records can vary) and we have to split it into two files based on another file. e.g.
File1:
UHDR 2008112
"25187","00000022","00",21-APR-1991,"" ,"D",-000000519,+0000000000,"C", ,+000000000,+000000000,000000000,"2","" ,21-APR-1991... (7 Replies)
Discussion started by: er_ashu
7 Replies
3. Shell Programming and Scripting
Hi ,
I have one file which has many headers.
Say suppose
HEDAER
..data DATA DATA
..data
..data
HEADER
..data
..data
DATA
.data
HEADER.
..data
..data
If there are 3 HEADERS in source file then I need to split the source file into 3 separate file.... (2 Replies)
Discussion started by: tanyaheerani
2 Replies
4. Shell Programming and Scripting
Hi All,
I have a rather stange set of requirements that I'm hoping someone here could help me with. We receive a file that is actually a concatenation of 4 files (don't believe this would change, but ideally the solution would handle n files).
The super-file looks like:... (7 Replies)
Discussion started by: Leedor
7 Replies
5. Shell Programming and Scripting
I have an input file with contents like:
MainFile.dat:
12247689|7896|77698080
16768900|hh78|78959390
12247689|7896|77698080
16768900|hh78|78959390
12247689|7896|77698080
16768900|hh78|78959390
12247689|7896|77698080
16768900|hh78|78959390
12247689|7896|77698080
16768900|hh78|78959390
... (4 Replies)
Discussion started by: rkrish
4 Replies
6. UNIX for Dummies Questions & Answers
Dear All,
I have two files but want to extract data from one based on another... can you please help me
file 1
David
Tom
Ellen
and file 2
David|0010|testnamez|resultsz
David|0004|testnamex|resultsx
Tom|0010|testnamez|resultsz
Tom|0004|testnamex|resultsx
Ellen|0010|testnamez|resultsz... (12 Replies)
Discussion started by: A-V
12 Replies
7. Shell Programming and Scripting
Hi All,
I have more than half million lines of XML file , wanted to split in four files in a such a way that top 7 lines should be present in each file on top and bottom line of should be present in each file at bottom.
from the 8th line actual record starts and each record contains 15 lines... (14 Replies)
Discussion started by: ajju
14 Replies
8. Shell Programming and Scripting
hdr=$(cut -c1 $path$file|head -1)#extract header”H”
trl=$(cut -c|path$file|tail -1)#extract trailer “T”
SplitFile=$(cut -c 50-250 $path 1$newfile |sed'$/ *$//' head -1')# to trim white space and extract table name
If; then # start loop if it is a header
While read I #read file
Do... (4 Replies)
Discussion started by: SwagatikaP1
4 Replies
9. Shell Programming and Scripting
Hello,
I have some large text files that look like,
putrescine
Mrv1583 01041713302D
6 5 0 0 0 0 999 V2000
2.0928 -0.2063 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
5.6650 0.2063 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
3.5217 ... (3 Replies)
Discussion started by: LMHmedchem
3 Replies
10. UNIX for Beginners Questions & Answers
Hi ,
I am having a scenario where I need to split the file based on two field values. The file is a fixed length file.
ex:
AA0998703000000000000190510095350019500010005101980301
K 0998703000000000000190510095351019500020005101480 ... (4 Replies)
Discussion started by: saj
4 Replies
LEARN ABOUT DEBIAN
directory::scratch::structured
Directory::Scratch::Structured(3pm) User Contributed Perl Documentation Directory::Scratch::Structured(3pm)
NAME
Directory::Scratch::Structured - creates temporary files and directories from a structured description
SYNOPSIS
my %tree_structure =
(
dir_1 =>
{
subdir_1 =>{},
file_1 =>[],
file_a => [],
},
dir_2 =>
{
subdir_2 =>
{
file_22 =>[],
file_2a =>[],
},
file_2 =>[],
file_a =>['12345'],
file_b =>[],
},
file_0 => [] ,
) ;
use Directory::Scratch::Structured qw(create_structured_tree) ;
my $temporary_directory = create_structured_tree(%tree_structure) ;
or
use Directory::Scratch ;
use Directory::Scratch::Structured qw(piggyback_directory_scratch) ;
my $temporary_directory = Directory::Scratch->new;
$temporary_directory->create_structured_tree(%tree_structure) ;
DESCRIPTION
This module adds a create_structured_tree subroutine to the Directory::Scratch.
DOCUMENTATION
I needed a subroutine to create a bunch of temporary directories and files while running tests. I used the excellent Directory::Scratch to
implement such a functionality. I proposed the subroutine to the Directory::Scratch author but he preferred to implement a subroutine
using an unstructured input data based on the fact that Directory::Scratch didn't use structured data. This is, IMHO, flawed design, though
it may require slightly less typing.
I proposed a hybrid solution to reduce the amount of subroutines and integrate the subroutine using structured input into
Directory::Scratch but we didn't reach an agreement on the API. Instead I decided that I would piggyback on Directory::Scratch.
You can access create_structured_tree through a subroutine or a method through a Directory::Scratch object.
Whichever interface you choose, the argument to the create_structured_tree consists of tuples (hash entries). The key represents the name
of the object to create in the directory.
If the value is of type:
ARRAY
A file will be created, it's contents are the contents of the array (See Directory::Scratch)
HASH
A directory will be created. the element of the hash will also be , recursively, created
OTHER
The subroutine will croak.
SUBROUTINES
/METHODS
create_structured_tree
use Directory::Scratch::Structured qw(create_structured_tree) ;
my $temporary_directory = create_structured_tree(%tree_structure) ;
my $base = $temporary_directory->base() ;
Returns a default Directory::Scratch object.
directory_scratch_create_structured_tree
Adds create_structured_tree to Directory::Scratch when you Load Directory::Scratch::Structured with the piggyback_directory_scratch
option.
use Directory::Scratch ;
use Directory::Scratch::Structured qw(piggyback_directory_scratch) ;
my $temporary_directory = Directory::Scratch->new;
$temporary_directory->create_structured_tree(%tree_structure) ;
_create_structured_tree
Used internally by both interfaces
piggyback
Used internally to piggyback Directory::Scratch.
BUGS AND LIMITATIONS
None so far.
AUTHOR
Khemir Nadim ibn Hamouda
CPAN ID: NKH
mailto:nadim@khemir.net
LICENSE AND COPYRIGHT
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Directory::Scratch::Structured
You can also look for information at:
o AnnoCPAN: Annotated CPAN documentation
<http://annocpan.org/dist/Directory-Scratch-Structured>
o RT: CPAN's request tracker
Please report any bugs or feature requests to L <bug-directory-scratch-structured@rt.cpan.org>.
We will be notified, and then you'll automatically be notified of progress on your bug as we make changes.
o Search CPAN
<http://search.cpan.org/dist/Directory-Scratch-Structured>
SEE ALSO
Directory::Scratch
perl v5.10.1 2010-03-22 Directory::Scratch::Structured(3pm)