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
javah(1)						      General Commands Manual							  javah(1)

NAME
javah - C header and stub file generator SYNOPSIS
javah [ options ] fully-qualified-classname ... javah_g [ options ] fully-qualified-classname ... DESCRIPTION
The javah command generates C header and source files that are needed to implement native methods. The generated header and source files are used by C programs to reference instance variables of an object from native source code. The .h file contains a structure definition whose layout parallels that of the corresponding class. The fields in the structure correspond to instance variables in the class. The name of the header file and the structure declared within it are derived from the name of the class. If the class passed to javah is inside a package, the package name is prepended to both the header file name and the structure name. Underscores ( _ ) are used as name delimiters. By default, javah creates a header file for each class listed on the command line and puts the files in the current directory. Use the -stubs option to create source files. Use the -o option to concatenate the results for all listed classes into a single file. The new native method interface, Java Native Interface (JNI), does not require header information or stub files. The javah command can still be used to generate native method function prototypes needed for JNI-style native methods. javah produces JNI-style output by default, and places the result in the .h file. The javah_g version is a non-optimized version of javah suitable for use with debuggers like jdb. OPTIONS
The following options are supported: -o outputfile Concatenates the resulting header or source files for all the classes listed on the command line into outputfile. Only the -o or -d option may be used. -bootclasspath path Specifies path from which to load bootstrap classes. By default, the bootstrap classes are the classes implementing the core Java 2 platform located in jre/lib/rt.jar and several other jar files. -classpath path Specifies the path javah uses to look up classes. Overrides the default of the CLASSPATH environment variable if it is set. Directories are separated by colons. Thus the general format for path is: .:<your_path> For example: .:/home/avh/classes:/usr/local/java/classes -d directory Sets the directory where javah saves the header files or the stub files. -force Specifies that output files should always be written. -help Prints help message for javah usage. -jni Causes javah to create an output file containing JNI-style native method function prototypes. This is the default output, so use of -jni is optional. -old Specifies the old JDK1.0-style header files should be generated. -stubs Causes javah to generate C declarations from the Java object file. -trace Tracing is no longer supported. Instead, use the -verbose:jni option of the virtual machine. -verbose Indicates verbose output and causes javah to print a message to stdout concerning the status of the generated files. -version Print out javah version information. -Joption Pass option to the Java virtual machine, where option is one of the options described on the man page for the java applica- tion launcher, java(1). For example, -J-Xms48m sets the startup memory to 48 megabytes. It is a common convention for -J to pass options to the underlying virtual machine. ENVIRONMENT VARIABLES
CLASSPATH Used to provide the system with a path to user-defined classes. Directories are separated by colons, for example, .:/home/avh/classes:/usr/local/java/classes SEE ALSO
java(1), javac(1), javadoc(1), javap(1), jdb(1) 13 June 2000 javah(1)
All times are GMT -4. The time now is 01:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy