Sponsored Content
Top Forums Shell Programming and Scripting reading fixed length flat file and calling java code using shell scripting Post 302340521 by willywilly on Monday 3rd of August 2009 05:52:48 PM
Old 08-03-2009
reading fixed length flat file and calling java code using shell scripting

I am new to shell scripting and I have to to the following

I have a flat file with storename(lenth 20) , emailaddress(lenth 40), location(15). There is NO delimiters in that file.

Like the following str00001.txt

StoreName emailaddress location
---------------- ------------------ -----------
xxxxxxx iiiiiiiiii@yahoo.com mmmmm
yyyyyyyyyyy acb@gmail.com lllllllllllllllllllllllll
zzz zzz@email.com ujeuri


I have to read line by line in the flat file get the email address and location and then make a call my java servlet by passing in the URL
1. Read line by line
2. Set email address and location in a variable
String email = "acb@gmail.com”;
String loc = “lllllllllllllllllllllllll”;
3. set it my url like this (i know how to call the servlet through shell scripting)

http://localhost:8080/emailer/sslPages/sendemailservlet?emailAddress= email% location= loc
4. process next line from the flat file (loop until end of the file)
5. end of the loop I have to delete str00001.txt file

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Fixed Length records- Korne Shell Program.

Hi, I need some help regarding in writing a Korne shell script, in determining the fixed length records in a data file. We have already utility in place, which does this work. The Code for this is as below. In the below $1 is the parameter passed to the script, which is the data file name. ... (4 Replies)
Discussion started by: nrajesh_2009
4 Replies

2. UNIX for Dummies Questions & Answers

What the command to find out the record length of a fixed length file?

I want to find out the record length of a fixed length file? I forgot the command. Any body know? (9 Replies)
Discussion started by: tranq01
9 Replies

3. UNIX for Dummies Questions & Answers

Convert a tab delimited/variable length file to fixed length file

Hi, all. I need to convert a file tab delimited/variable length file in AIX to a fixed lenght file delimited by spaces. This is the input file: 10200002<tab>US$ COM<tab>16/12/2008<tab>2,3775<tab>2,3783 19300978<tab>EURO<tab>16/12/2008<tab>3,28523<tab>3,28657 And this is the expected... (2 Replies)
Discussion started by: Everton_Silveir
2 Replies

4. UNIX for Dummies Questions & Answers

Conditional sorting on fixed length flat file

I have a fixed length file that need to be sorted according to the following rule IF B=1 ORDER by A,B Else ORDER by A,C Input file is ABC 131 112 122 231 212 222 Output needed ABC 112 131 122 212 231 222 (1 Reply)
Discussion started by: zsk_00
1 Replies

5. Shell Programming and Scripting

Exporting a flat fixed length file (Urgent)

Hi All, So far, I've been extracting data from db2 tables and exporting the file as a tab delimited file into a UNIX server using the following command: export to /.../.../.../.../.../SM_RAW_DATA.dat of del modified by coldel| nochardel select a.accno, a.CUR_BL_AM, ... (1 Reply)
Discussion started by: jj2485
1 Replies

6. Shell Programming and Scripting

how to read fixed length flat file....

Hi Gurus, Thanks in advance... I am new to writing shell scripting and help me out reading a flat file with fixed length. I have a fixed length flat file with storename(lenth 6) , emailaddress(lenth 15), location(10). There is NO delimiters in that file. Like the following str00001.txt... (2 Replies)
Discussion started by: willywilly
2 Replies

7. Shell Programming and Scripting

Fixed length flat file extraction

Hii ,I am new to Unix ,i have a flat file which is (fixed length) sitting in unix,Which is holding the data for a table.I want to extract one column(length7-10) on the basis of another column(length13-15) and want only one single row Example: Below is the sample of flat file. 1111 AAAA 100 ... (4 Replies)
Discussion started by: laxmi1166
4 Replies

8. Shell Programming and Scripting

Flat file-make field length equal to header length

Hello Everyone, I am stuck with one issue while working on abstract flat file which i have to use as input and load data to table. Input Data- ------ ------------------------ ---- ----------------- WFI001 Xxxxxx Control Work Item A Number of Records ------ ------------------------... (5 Replies)
Discussion started by: sonali.s.more
5 Replies

9. Shell Programming and Scripting

How to add trailer record at the end of the flat file in the unix ksh shell scripting?

Hi, How to add trailer record at the end of the flat file in the unix ksh shell scripting can you please let me know the procedure Regards Srikanth (3 Replies)
Discussion started by: srikanth_sagi
3 Replies

10. UNIX for Advanced & Expert Users

Help on Shell Scripting - to store output to a fixed file

Hi I have a file called "test.txt" and it looks like this x y z x/c y/c/b now, i want to run a command and its output will be like this x 10 y/c/b 20 z 78 -------- my requirement is, i want to add the command output to "test.txt" as like below x 10 y ... (1 Reply)
Discussion started by: siva kumar
1 Replies
mdbFontset(5)							 The m17n Library						     mdbFontset(5)

NAME
mdbFontset - Fontset DESCRIPTION
The m17n library loads a fontset definition from the m17n database by the tags <fontset, FONTSET-NAME>. The plist format of the data is as follows: FONTSET ::= PER-SCRIPT * PER-CHARSET * FALLBACK * PER-SCRIPT ::= '(' SCRIPT PER-LANGUAGE + ')' PER-LANGUAGE ::= '(' LANGUAGE FONT-SPEC-ELEMENT + ')' PER-CHARSET ::= '(' CHARSET FONT-SPEC-ELEMENT + ')' FALLBACK ::= FONT-SPEC-ELEMENT FONT-SPEC-ELEMENT ::= '(' FONT-SPEC [ FLT-NAME ] ')' FONT-SPEC ::= '(' [ FOUNDRY FAMILY [ WEIGHT [ STYLE [ STRETCH [ ADSTYLE ]]]]] REGISTRY [ OTF-SPEC ] [ LANG-SPEC ] ')' SCRIPT is a symbol of script name (e.g. latin, han) or nil. LANGUAGE is a two-letter symbol of language name code defined by ISO 639 (e.g. ja, zh) or nil. FONT-SPEC is to specify properties of a font. FOUNDRY to REGISTRY are symbols corresponding to Mfoundry to Mregistry property of a font. See m17nFont for the meaning of each property. OTF-SPEC is a symbol specifyng the required OTF features. The symbol name has the following syntax. OTF-SPEC-NAME ::= ':otf=' SCRIPT LANGSYS ? GSUB-FEATURES ? GPOS-FEATURES ? SCRIPT ::= SYMBOL LANGSYS ::= '/' SYMBOL GSUB-FEATURES ::= '=' FEATURE-LIST ? GPOS-FEATURES ::= '+' FEATURE-LIST ? FEATURE-LIST ::= '~' ? FEATURE ( ',' '~' ? FEATURE ',' ) Here, FEATURE is a four-letter Open Type feature. LANG-SPEC is a symbol specifying the required language support. The symbol name has the following syntax. LANG-SPEC-NAME ::= ':lang=' LANG Here, LANG is a two or three-letter ISO-639 language code. FLT-NAME is a name of Font Layout Table (Font Layout Table). EXAMPLE
This is an example of PER_SCRIPT. (han (ja ((jisx0208.1983-0))) (zh ((gb2312.1980-0))) (nil ((big5-0)))) It instructs the font selector to use a font of registry 'jisx0208.1983-0' for a 'han' character (i.e. a character whose Mscript property is 'han') if the character has Mlanguage text property 'ja' in an M-text and the character is in the repertories of such fonts. Otherwise, try a font of registry 'gb2312.1980-0' or 'big5-0'. If that 'han' character does not have Mlanguage text property, try all three fonts. See the function mdraw_text() for the detail of how a font is selected. COPYRIGHT
Copyright (C) 2001 Information-technology Promotion Agency (IPA) Copyright (C) 2001-2011 National Institute of Advanced Industrial Science and Technology (AIST) Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License <http://www.gnu.org/licenses/fdl.html>. Version 1.6.2 12 Jan 2011 mdbFontset(5)
All times are GMT -4. The time now is 06:24 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy