Sponsored Content
Top Forums Shell Programming and Scripting Split one file to Multiple file with report basis in unix Post 302493748 by krbala1985 on Thursday 3rd of February 2011 03:16:36 PM
Old 02-03-2011
Hi ,Thanks for writing me...

i want the report file like below from 11020111.CLT.

MUMBAI0001.txt
Code:
%sAEGONCA| |MUMBAI | :EXPC|N|D
 
DRAWEE LOC.NAME|DEPOSIT DATE|ACTIVATION DATE|DAY|AMOUNT|CLIENT CODE|PRODUCT|CBP.NO|EXP.CLEARING DATE
MUMBAI|29/01/2011|29/01/2011|Tue| 21643.00|AEGONCA|aaaa|110290361013 |01/02/2011
MUMBAI|29/01/2011|29/01/2011|Tue| 142.00|AEGONCA|aaaa|110290361014 |01/02/2011
BHUBANESHWAR (ORI.)|31/01/2011|31/01/2011|Tue| 70751.00|AEGONCA|CCLR|110310758005 |01/02/2011
ERNAKULAM (KERALA)|31/01/2011|31/01/2011|Tue| 68980.00|AEGONCA|CCLR|110310905015 |01/02/2011
AHMEDABAD|31/01/2011|31/01/2011|Tue| 108000.00|AEGONCA|aaaa|110310924024 |01/02/2011
BHOPAL (M.P.)|31/01/2011|31/01/2011|Tue| 97832.00|AEGONCA|aaaa|110310959001 |01/02/2011
%eAEGONCA| |MUMBAI | :EXPC

MUMBAI002.TXT
Code:
%sAGENTCA| |MUMBAI | :EXPC|N|D
DRAWEE LOC.NAME|DEPOSIT DATE|ACTIVATION DATE|DAY|AMOUNT|CLIENT CODE|PRODUCT|CBP.NO|EXP.CLEARING DATE
UDIPI(KAR) CASH|31/01/2011|31/01/2011|Tue| 250.00|AGENTCA|aaaa|110310667003 |01/02/2011
MANGALORE(KAR) CASH|31/01/2011|31/01/2011|Tue| 350.00|AGENTCA|aaaa|110310839008 |01/02/2011
ERNAKULAM (KERALA)|31/01/2011|31/01/2011|Tue| 250.00|AGENTCA|aaaa|110310905004 |01/02/2011
ERNAKULAM (KERALA)|31/01/2011|31/01/2011|Tue| 600.00|AGENTCA|aaaa|110310905005 |01/02/2011
ERNAKULAM (KERALA)|31/01/2011|31/01/2011|Tue| 1500.00|AGENTCA|aaaa|110310905006 |01/02/2011
%eAGENTCA| |MUMBAI | :EXPC
 
%sAGENTCA| |MUMBAI | :EXPC|Y|D
DRAWEE LOC.NAME|DEPOSIT DATE|ACTIVATION DATE|DAY|AMOUNT|CLIENT CODE|PRODUCT|CBP.NO|EXP.CLEARING DATE
UDIPI(KAR) CASH|31/01/2011|31/01/2011|Tue| 2502.00|AGENTCA|aaaa|110310667003 |01/02/2011
MANGALORE(KAR) CASH|31/01/2011|31/01/2011|Tue| 3050.00|AGENTCA|aaaa|110310839008 |01/02/2011
ERNAKULAM (KERALA)|31/01/2011|31/01/2011|Tue| 2250.00|AGENTCA|aaaa|110310905004 |01/02/2011
ERNAKULAM (KERALA)|31/01/2011|31/01/2011|Tue| 600.00|AGENTCA|aaaa|110310905005 |01/02/2011
ERNAKULAM (KERALA)|31/01/2011|31/01/2011|Tue| 1520.00|AGENTCA|aaaa|110310905006 |01/02/2011
%eAGENTCA| |MUMBAI | :EXPC

MUMBAI003.TXT
Code:
%sPFRDAXX| |MUMBAI | :EXPC|N|D
 
DRAWEE LOC.NAME|DEPOSIT DATE|ACTIVATION DATE|DAY|AMOUNT|CLIENT CODE|PRODUCT|CBP.NO|EXP.CLEARING DATE
CALCUTTA|31/01/2011|31/01/2011|Tue| 15000.00|PFRDAXX|aaaa|110311499006 |01/02/2011
%ePFRDAXX| |MUMBAI | :EXPC

PLEASE HELP ON THIS. thanks in advance.Smilie

---------- Post updated at 03:16 PM ---------- Previous update was at 03:12 PM ----------

This script is not working...pls help

Last edited by Scott; 02-06-2011 at 10:53 AM.. Reason: Code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with split the file content into multiple different file

Input file content: NA_10001 XA_10081 NG_10015 AC_1321.1 . . Desired output file: ls *.txt NA_10001.txt XA_10081.txt NG_10015.txt AC_1321.1.txt cat NA_10001.txt NA_10001 cat XA_10081.txt XA_10081 (1 Reply)
Discussion started by: perl_beginner
1 Replies

2. Shell Programming and Scripting

Help with split one file content into multiple different file

Input file: cat input_file.txt data_1 2342 data_3 242 data_1 3546 data_5 458 data_10 342 data_30 42 data_10 346 content_50 48 content_1 2343 Desired output: cat output_file1.txt data_1 2342 data_3 242 data_1 3546 data_5 458 (2 Replies)
Discussion started by: perl_beginner
2 Replies

3. Shell Programming and Scripting

Split file in unix into multiple files

Hi Gurus I have to split the incoming source file into multiple file. File contains some unwanted XML tags also . Files looks like some XML tags FILEHEADERABC 12 -- --- ---- EOF some xml tags xxxFILEHEADERABC 13 -- --- ---- EOF I have to ignore XML tags and only split file... (6 Replies)
Discussion started by: manish2608
6 Replies

4. Shell Programming and Scripting

Split a file into multiple files based on first two digits of file.

Hi , I do have a fixedwidth flatfile that has data for 10 different datasets each identified by the first two digits in the flatfile. 01 in the first two digit position refers to Set A 02 in the first two digit position refers to Set B and so on I want to genrate 10 different files from my... (6 Replies)
Discussion started by: okkadu
6 Replies

5. Shell Programming and Scripting

How to split file into multiple files using awk based on 1 field in the file?

Good day all I need some helps, say that I have data like below, each field separated by a tab DATE NAME ADDRESS 15/7/2012 LX a.b.c 15/7/2012 LX1 a.b.c 16/7/2012 AB a.b.c 16/7/2012 AB2 a.b.c 15/7/2012 LX2 a.b.c... (2 Replies)
Discussion started by: alexyyw
2 Replies

6. Shell Programming and Scripting

Splitting XML file on basis of line number into multiple file

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)
Discussion started by: ajju
14 Replies

7. Linux

Split a large textfile (one file) into multiple file to base on ^L

Hi, Anyone can help, I have a large textfile (one file), and I need to split into multiple file to break each file into ^L. My textfile ========== abc company abc address abc contact ^L my company my address my contact my skills ^L your company your address ========== (3 Replies)
Discussion started by: fspalero
3 Replies

8. UNIX for Beginners Questions & Answers

Split a txt file on the basis of line number

I have to split a file containing 100 lines to 5 files say from lines ,1-20 ,21-30 ,31-40 ,51-60 ,61-100 Here is i can do it for 2 file but how to handle it for more than 2 files awk 'NR < 21{ print >> "a"; next } {print >> "b" }' $input_file Please advidse. Thanks (4 Replies)
Discussion started by: abhaydas
4 Replies

9. UNIX for Beginners Questions & Answers

Split large file into 24 small files on one hour basis

I Have a large file with 24hrs log in the below format.i need to split the large file in to 24 small files on one hour based.i.e ex:from 09:55 to 10:55,10:55-11:55 can any one help me on this.! ... (20 Replies)
Discussion started by: Raghuram717
20 Replies

10. UNIX for Beginners Questions & Answers

Split into multiple files by using Unique columns in a UNIX file

I have requirement to split below file (sample.csv) into multiple files by using the unique columns (first 3 are unique columns) sample.csv 123|22|56789|ABCDEF|12AB34|2019-07-10|2019-07-10|443.3400|1|1 123|12|5679|BCDEFG|34CD56|2019-07-10|2019-07-10|896.7200|1|2... (3 Replies)
Discussion started by: RVSP
3 Replies
GIT-SH-SETUP(1) 						    Git Manual							   GIT-SH-SETUP(1)

NAME
git-sh-setup - Common Git shell script setup code SYNOPSIS
. "$(git --exec-path)/git-sh-setup" DESCRIPTION
This is not a command the end user would want to run. Ever. This documentation is meant for people who are studying the Porcelain-ish scripts and/or are writing new ones. The git sh-setup scriptlet is designed to be sourced (using .) by other shell scripts to set up some variables pointing at the normal Git directories and a few helper shell functions. Before sourcing it, your script should set up a few variables; USAGE (and LONG_USAGE, if any) is used to define message given by usage() shell function. SUBDIRECTORY_OK can be set if the script can run from a subdirectory of the working tree (some commands do not). The scriptlet sets GIT_DIR and GIT_OBJECT_DIRECTORY shell variables, but does not export them to the environment. FUNCTIONS
die exit after emitting the supplied error message to the standard error stream. usage die with the usage message. set_reflog_action set the message that will be recorded to describe the end-user action in the reflog, when the script updates a ref. git_editor runs an editor of user's choice (GIT_EDITOR, core.editor, VISUAL or EDITOR) on a given file, but error out if no editor is specified and the terminal is dumb. is_bare_repository outputs true or false to the standard output stream to indicate if the repository is a bare repository (i.e. without an associated working tree). cd_to_toplevel runs chdir to the toplevel of the working tree. require_work_tree checks if the current directory is within the working tree of the repository, and otherwise dies. require_work_tree_exists checks if the working tree associated with the repository exists, and otherwise dies. Often done before calling cd_to_toplevel, which is impossible to do if there is no working tree. require_clean_work_tree <action> [<hint>] checks that the working tree and index associated with the repository have no uncommitted changes to tracked files. Otherwise it emits an error message of the form Cannot <action>: <reason>. <hint>, and dies. Example: require_clean_work_tree rebase "Please commit or stash them." get_author_ident_from_commit outputs code for use with eval to set the GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL and GIT_AUTHOR_DATE variables for a given commit. create_virtual_base modifies the first file so only lines in common with the second file remain. If there is insufficient common material, then the first file is left empty. The result is suitable as a virtual base input for a 3-way merge. GIT
Part of the git(1) suite Git 1.8.3.1 06/10/2014 GIT-SH-SETUP(1)
All times are GMT -4. The time now is 10:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy