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. And the file has some white spaces(actually its a flatfile)
So when spliiting the file I need to get the white spaces even.
Below is the script I wrote, but this does not recognise whitespaces. It wud b great if someone helps me with this.
Code is :
Iam struggling for getting whiete spaces included. Can some one please respond to my query.
I am new to this forum and I dont know how to check the response. So please can some one who is assisting mail me to sanasheetal@yahoo.com
Thanks in Advance.
Last edited by DukeNuke2; 02-05-2009 at 06:06 AM..
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)
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)
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)
Hi Friends,
We have a process where we use 11 different files
filename_1
filename_2 and so on to filename11
now we have only 1 file filename_1
if we split the file to 11 files based on KB and use it in our process,
will be having any duplicates?
not sure how splitting works while... (3 Replies)
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)
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)
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)
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 SUSE
create_foreign_data_wrapper
CREATE FOREIGN DATA WRAPPER(7) SQL Commands CREATE FOREIGN DATA WRAPPER(7)NAME
CREATE FOREIGN DATA WRAPPER - define a new foreign-data wrapper
SYNOPSIS
CREATE FOREIGN DATA WRAPPER name
[ VALIDATOR valfunction | NO VALIDATOR ]
[ OPTIONS ( option 'value' [, ... ] ) ]
DESCRIPTION
CREATE FOREIGN DATA WRAPPER creates a new foreign-data wrapper. The user who defines a foreign-data wrapper becomes its owner.
The foreign-data wrapper name must be unique within the database.
Only superusers can create foreign-data wrappers.
PARAMETERS
name The name of the foreign-data wrapper to be created.
VALIDATOR valfunction
valfunction is the name of a previously registered function that will be called to check the generic options given to the foreign-
data wrapper, as well as to foreign servers and user mappings using the foreign-data wrapper. If no validator function or NO VALIDA-
TOR is specified, then options will not be checked at creation time. (Foreign-data wrappers will possibly ignore or reject invalid
option specifications at run time, depending on the implementation.) The validator function must take two arguments: one of type
text[], which will contain the array of options as stored in the system catalogs, and one of type oid, which will be the OID of the
system catalog containing the options. The return type is ignored; the function should indicate invalid options using the ereport()
function.
OPTIONS ( option 'value' [, ... ] )
This clause specifies options for the new foreign-data wrapper. The allowed option names and values are specific to each foreign
data wrapper and are validated using the foreign-data wrapper library. Option names must be unique.
NOTES
At the moment, the foreign-data wrapper functionality is very rudimentary. The purpose of foreign-data wrappers, foreign servers, and user
mappings is to store this information in a standard way so that it can be queried by interested applications. One such application is
dblink; see in the documentation. The functionality to actually query external data through a foreign-data wrapper library does not exist
yet.
There is currently one foreign-data wrapper validator function provided: postgresql_fdw_validator, which accepts options corresponding to
libpq connection parameters.
EXAMPLES
Create a foreign-data wrapper dummy:
CREATE FOREIGN DATA WRAPPER dummy;
Create a foreign-data wrapper postgresql with validator function postgresql_fdw_validator:
CREATE FOREIGN DATA WRAPPER postgresql VALIDATOR postgresql_fdw_validator;
Create a foreign-data wrapper mywrapper with some options:
CREATE FOREIGN DATA WRAPPER mywrapper
OPTIONS (debug 'true');
COMPATIBILITY
CREATE FOREIGN DATA WRAPPER conforms to ISO/IEC 9075-9 (SQL/MED), with the exception that the VALIDATOR clause is an extension and the
clauses LIBRARY and LANGUAGE are not yet implemented in PostgreSQL.
Note, however, that the SQL/MED functionality as a whole is not yet conforming.
SEE ALSO
ALTER FOREIGN DATA WRAPPER [alter_foreign_data_wrapper(7)], DROP FOREIGN DATA WRAPPER [drop_foreign_data_wrapper(7)], CREATE SERVER [cre-
ate_server(7)], CREATE USER MAPPING [create_user_mapping(7)]
SQL - Language Statements 2010-05-14 CREATE FOREIGN DATA WRAPPER(7)