Sponsored Content
Top Forums UNIX for Advanced & Expert Users Reading a file and writing the file name to a param file. Post 302139364 by thebeginer on Friday 5th of October 2007 04:22:51 PM
Old 10-05-2007
Reading a file and writing the file name to a param file.

Hi All,

Not sure if this would be in a dummies sectiin or advanced. I'm looking for a script if someone has doen something like this.

I have list of files -
adc_earnedpoints.20070630.txt
adc_earnedpoints.20070707.txt
adc_earnedpoints.20070714.txt
adc_earnedpoints.20070721.txt
adc_earnedpoints.20070728.txt
adc_earnedpoints.20070804.txt
adc_earnedpoints.20070811.txt
adc_earnedpoints.20070818.txt

I need to process these files using informatica process and write the content of the file to a DB table. While writing the file to db i need to capture the date from the file name and pass to a parameter file in unix and use the parameter file to write the data value in db. And also i need to process 1 file for each run so that i can grab teh date from teh file name and capture in a param file which will be used by Informatica process. Something like this -

file processing adc_earnedpoints.20070630.txt should be renamed to generic file adc_earnedpoints.txt and the date 20070630 should be wrriten to a param file with values -
s_load_earned_points (informatica session)
$$process_date=20070630 (which will be called in teh informatica mapping.

And similarly process teh rest of files.

Has anyone ever done something like this before, if so could you please provide teh script for this.

Any help is greatly & kindly appreciated.

Regards,
Beginer.
 

10 More Discussions You Might Find Interesting

1. Programming

Reading and Writing file on LAN

Hi gurus I am not a C programmer but I need to read and write files on a computer on LAN using IP address. Suppose on a computer that has an IP 192.168.0.2 Any help or code example. I did in JAVA using URL, but do not know how to do in ANSI-C. In java: ------- URL url = new... (3 Replies)
Discussion started by: lucky001
3 Replies

2. UNIX for Dummies Questions & Answers

Script for reading filelist and preparing param file.

Hi All, Not sure if this would be in a dummies sectiin or advanced. I'm looking for a script if someone has doen something like this. I have list of files - adc_earnedpoints.20070630.txt adc_earnedpoints.20070707.txt adc_earnedpoints.20070714.txt adc_earnedpoints.20070721.txt... (2 Replies)
Discussion started by: thebeginer
2 Replies

3. UNIX for Dummies Questions & Answers

reading ,writing,appending ,manipulating a file.

Hi my prob statement is to create a new file or to append to the 1tst file the followign chages. File 1: txt file. portfolio No a b c d abc 1 Any Any Any charString cds 2 values values values charString efd 3 can can can charString fdg 4 come come come charString... (4 Replies)
Discussion started by: szchmaltz
4 Replies

4. UNIX for Dummies Questions & Answers

Log File Writing and Reading

Hi all, I have the following shell script code which tries to sftp and writes the log into the log file. TestConnection () { echo 'Connection to ' $DESTUSERNAME@$DESTHOSTNAME $SETDEBUG if ]; then rm $SCRIPT ; fi touch $SCRIPT echo "cd" $REMOTEDIR >> $SCRIPT echo "quit" >>... (10 Replies)
Discussion started by: valluvan
10 Replies

5. Programming

I need help with file reading/writing in C

Hello everybody, I'm trying to code a program which makes the following: It sends an ARP request frame and when it gets the reply, extracts the IP address of source and writes it to a .txt file. This is gonna be done with many hosts (with a for() loop), so, the text file would look like... (2 Replies)
Discussion started by: Zykl0n-B
2 Replies

6. Shell Programming and Scripting

Reading data from DataBase and Writing to a file

Hi All, Please help me in writing data to a file in one row. In database there is a column which contains large data which does not fit in the file in one row. The column contains list of paths. I want to write these paths to a file in one row. Please find the code below writes : ... (2 Replies)
Discussion started by: rajeshorpu
2 Replies

7. Shell Programming and Scripting

Searching for Log / Bad file and Reading and writing to a flat file

Need to develop a unix shell script for the below requirement and I need your assistance: 1) search for file.log and file.bad file in a directory and read them 2) pull out "Load_Start_Time", "Data_File_Name", "Error_Type" from log file 4) concatinate each row from bad file as... (3 Replies)
Discussion started by: mlpathir
3 Replies

8. Shell Programming and Scripting

reading a file extracting information writing to a file

Hi I am trying to extract information out of a file but keep getting grep cant open errors the code is below: #bash #extract orders with blank address details # # obtain the current date # set today to the current date ccyymmdd format today=`date +%c%m%d | cut -c24-31` echo... (8 Replies)
Discussion started by: Bruble
8 Replies

9. Shell Programming and Scripting

Reading selected lines from a param file

Hi all, I have a question for the Gurus. I apologize if this has bee shared before but I couldn't find the link. I am trying to read parameters from an external parameter file. What I m trying to achieve is read selected lines from an external parameter file into the script. for eg my param... (4 Replies)
Discussion started by: maverick1947
4 Replies

10. Shell Programming and Scripting

Reading and writing in same file

Hi All, Here is my requirement. I am grepping through the log files and cutting some fields from the file to generate a csv file. Now I have to check if 2nd field is having some fixed value then with the help of 4th field I have to look in same log and run another grep command to retrieve the... (11 Replies)
Discussion started by: kmajumder
11 Replies
MOUNT_UDF(8)						    BSD System Manager's Manual 					      MOUNT_UDF(8)

NAME
mount_udf -- mount a UDF filesystem SYNOPSIS
mount_udf [-o options] [-s sessionStart] [-n lastRecordedLBA] [-b blockSize] [-p packetSizeInBlocks] [-v verificationPolicy] [-w] devicePath mountPath DESCRIPTION
The mount_udf command attaches the UDF filesystem residing on the device devicePath to the global filesystem namespace at the location indi- cated by mountPath. This command is normally executed by mount(8) at boot time. The options are as follows: -o options Options are specified with a -o flag followed by a comma separated string of options. See the mount(8) man page for possible options and their meanings. -v verificationPolicy This is an advanced option not useful for regular use. It controlls the verification policy when writing to RW type optical media. Its value can be "meta", "all", or "none". Policy "meta" means only the metadata are verified after they are written. This is the default policy. Policy "all" means to verify data written, which could be several times slower than policy "meta". Policy "none" does not verify any data. It is only slightly faster than "meta" in normal cases, but may result a corrupted UDF disc if the write of metadata fails. -s sessionStart This is an advanced option not useful for regular use. When manually mounting a UDF volume with Virtual Partition, it specifies the start Logical Block Address of the last session where UDF data structures (VRS and AVDP) resides. This value overrides the value obtained from the device. -n lastRecordedLBA This is an advanced option not useful for regular use. When manually mounting a UDF volume with Virtual Partition, it specifies the last recorded Logical Block Address where the UDF VAT ICB will be searched. This value overrides the value obtained from the device. -b blockSize This is an advanced option not useful for regular use. It specifies the block size in bytes used when mounting the UDF volume. This value overrides the value obtained from the device. -p packetSizeInBlocks This is an advanced option not useful for regular use. It specifies the packet size in blocks when manually mounting the UDF volume. This value overrides the value obtained from the device. -w This is an advanced option not useful for regular use. It forces to enable the experimental packet writing function on optical media that has not been fully supported, such as CD-R, CD-RW, DVD-R, DVD+R, HD DVD-R, and BD-R. Writing to these media does not work on some drives and may cause data corruption or data loss on some other drives. Therefore, this flag should be used only by file system developers when debugging the experimental write functions. The -s, -n, -b, and -p flags are not useful in normal use. They are mainly used for debugging and data recovery. Since the -s, -n, and -p flags are all specified in units of block size, when any of these flags are specified, it is strongly recommended that the -b flag is also specified. SEE ALSO
mount(2), unmount(2), fstab(5), mount(8) BUGS
Reading of all UDF revisions (1.02 - 2.60) on both block device (e.g., hard drives and USB drives) and most optical media is supported. Writing to block devices, DVD-RW and DVD+RW is supported with the following exceptions: (1) Cannot write Finder Info, Resource Fork, or other extended attributes in UDF volumes of revision 1.02 and 1.50; (2) Cannot write to mirrored metadata partition. HISTORY
The mount_udf utility first appeared in Mac OS X. 4th Berkeley Distribution December 6, 2006 4th Berkeley Distribution
All times are GMT -4. The time now is 02:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy