Sponsored Content
Full Discussion: Generating Dynamic Scripts
Top Forums UNIX for Dummies Questions & Answers Generating Dynamic Scripts Post 302830943 by mora on Tuesday 9th of July 2013 09:09:04 PM
Old 07-09-2013
Generating Dynamic Scripts

Hi,

Please give me an idea on how to achieve the below using a unix script.

From our source team we are getting files with in-proper delimiters because of which our data load is failing to avoid this we want to generate dynamic scripts as below.

Read the no of delimiters(which is dynamic in each file) and generate a file in /tmp/ with the below structure, so that we will call the generated file and create the object in database.

if the file has 3 delimiters than the structure should be as below.
Code:
create table REC_PRD.File_Name
(column_1 char(30), 
column_2 char(30),
column_3 char(30) )

Please help me to provide a logic on how can I acheive the above.

Thanks you, Mora

Moderator's Comments:
Mod Comment Dont forget to use code tags next time...

Last edited by vbe; 07-10-2013 at 05:13 AM..
 

10 More Discussions You Might Find Interesting

1. Programming

generating timer

I'm trying generate an interrupt every 1 seconds using itimer and My clock is not running. This is what i did : printf("about to sleep for 1 second \n"); signal(SIGALRM, wakeup); //myTimer.it_interval.tv_sec=0; //myTimer.it_interval.tv_usec =0; ... (5 Replies)
Discussion started by: Confuse
5 Replies

2. UNIX for Dummies Questions & Answers

Generating a CDR file using PHP scripts.

Hi, I need to do croning in PHP to generate a CDR (Call Details Record) file daily from the mysql database. The CDR file has to be named in a certain sequence such as xx00000xxx200604080850.cdr. A new file is written every day. The generated CDR file is then ftp over to a server. I am... (0 Replies)
Discussion started by: kurl
0 Replies

3. Shell Programming and Scripting

Bash Scripts - File generating

Forgive the daft requests - I'm still a learner :D I need a script so that I can test another script (I'm confused already) The script I am looking for should generate a new file in the same directory (called newfile1 or what ever) and also generate text within the new file (Hello world? What... (1 Reply)
Discussion started by: JayC89
1 Replies

4. Shell Programming and Scripting

Generating Combinations

Hi, I need to generate all combinations upto n-1 level, if the input file looks like say, A B C D . . .... I need to generate all combinations such that first value remains constant and the remaning are combined with all possible ways. Output A AB AC AD ABC (1 Reply)
Discussion started by: zorg4u
1 Replies

5. Shell Programming and Scripting

Changing the Bash Scripts to Bourne Scripts:URGENT

Hi, I have to write a program to compute the checksums of files ./script.sh I wrote the program using bash and it took me forever since I am a beginner but it works very well. I'm getting so close to the deadline and I realised today that actually I have to use normal Bourne shell... (3 Replies)
Discussion started by: pgarg1989
3 Replies

6. UNIX for Advanced & Expert Users

Sql dynamic table / dynamic inserts

I have a file that reads File (X.txt) Contents of record 1: rdrDESTINATION_ADDRESS (String) "91 971502573813" rdrDESTINATION_IMSI (String) "000000000000000" rdrORIGINATING_ADDRESS (String) "d0 movies" rdrORIGINATING_IMSI (String) "000000000000000" rdrTRAFFIC_EVENT_TIME... (0 Replies)
Discussion started by: magedfawzy
0 Replies

7. Shell Programming and Scripting

Scripts - Dynamic text

Hi, I have a file in which I have to replace the text with system date. The text needs to be changed on daily basis automatically. Assume, in "test.txt", I have below lines: LOAD FILE MYFILE 'c:/test/test_2010_09_24.txt ----- ----- In the above, MYFILE value changes every day, the... (1 Reply)
Discussion started by: psnmak
1 Replies

8. Shell Programming and Scripting

KSH - How to call different scripts from master scripts based on a column in an Oracle table

Dear Members, I have a table REQUESTS in Oracle which has an attribute REQUEST_ACTION. The entries in REQUEST_ACTION are like, ME, MD, ND, NE etc. I would like to create a script which will will call other scripts based on the request action. Can we directly read from the REQUEST_ACTION... (2 Replies)
Discussion started by: Yoodit
2 Replies

9. Shell Programming and Scripting

Help with generating a script

I am a biologist who is new to linux and am having difficulty generating a script to do what I want it to do! I have tried basic grep commands, but even that does not give me back the data I want. I have many files that are all currently in .xslx and I'm not sure if they need to be .csv or .txt... (16 Replies)
Discussion started by: kellywilliams
16 Replies

10. Shell Programming and Scripting

Generating dynamic variables

Hi , i am unable to generate dynamic variables can any one please help me on the below issue j=1 {record_count_"$j"}=`db2 -xselect substr\(job_name,24\) rec_count from $libname.audit_table_nrt where job_name like \'DATAMART_DEL_RUN%\' and STS_FLAG=\'E\' and seq_no=$i` echo " record... (3 Replies)
Discussion started by: bhaskar v
3 Replies
dladdr(3C)																dladdr(3C)

NAME
dladdr() - get the symbolic information for an address SYNOPSIS
[flag]... cfile ... [library]... Multithread Usage This routine is thread-safe. DESCRIPTION
is one of a family of routines that give the user direct access to the dynamic linking facilities (using the option on the compiler or com- mand line). allows a process to obtain information about the symbol that most closely defines a given address. determines whether the specified address is located within one of the load modules (executable or shared libraries) that make up the process' address space. An address is deemed to fall within a load module when it is between the base address at which the load module was mapped and the highest vir- tual address mapped for that load module, inclusive. If a load module fits this criteria, its dynamic symbol table is searched to locate the nearest symbol to the specified address. The nearest symbol is the one whose value is equal to, or closest to but less than the speci- fied address. dlip is a pointer to a structure. The structure must be allocated by the user. The structure members are set by if the specified address falls within one of the load modules. The structure contains the following members: The fields of the structure contain the following: dli_fname Pointer to the filename of the load module containing the address. The contents of this memory location can change between calls to dli_fbase Handle to the load module. This can be used as the first argument to dli_sname Pointer to the name of the nearest symbol to the specified address. This symbol either has the same address, or is the nearest symbol with a lower address. The contents of this memory location can change between calls to dli_saddr Actual address of the nearest symbol. For code symbols, it contains the address of the OPD (Official Plabel Descrip- tor) for the nearest code symbol. dli_size (ELF process only) Size of the nearest symbol as defined in the dynamic symbol table. dli_bind (ELF process only) Binding attribute of the nearest symbol as defined in the dynamic symbol table. The values for this are those used for a symbol's binding in the ELF symbol table (see dli_type Type of the nearest symbol. For ELF process, this is the same as the value for type in the dynamic symbol table. The values for this are those used for a symbol's type in the ELF symbol table (see For SOM process, this can have the value or as defined in RETURN VALUE
If the specified address does not fall within one of the load modules, is returned; the contents of the structure are not modified. Other- wise, a non-zero value is returned and the fields of the structure are set. DIAGNOSTICS
If no symbol is found within the load module containing address whose value is less than or equal to address, the dli_sname, dli_saddr, and dli_size fields are set to the dli_bind field is set to and the dli_type field is set to For only a subset of externally visible symbols are typically exported: specifically those referenced by the load modules with which the is linked. The exact set of exported symbols for any shared library or the can be controlled using the linker (see ld(1)). ERRORS
If fails, a subsequent call to returns one of the following values: Invalid symbol address in load module. Cannot apply relocation in library. Address not found in any load module. Out of memory. failed on entry to or exit from failed on exit from failed on entry to SEE ALSO
cc(1), ld(1), sh(1), exec(2), dlclose(3C), dlerrno(3C), dlerror(3C), dlsym(3C). Texts and Tutorials (See the option) (See manuals(5) for ordering information) dladdr(3C)
All times are GMT -4. The time now is 04:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy