on 10-31-2008 8:01 PM
I have a file structure like Header-Transaction Records(100K)-Trailer with Transaction Records of 100k.
I want to process the this file through file-xi-file scenario.
If I got to write a operating sytstem command/script to split the file in chunks , how to write it for the file structure that i am talking abt above ??
Regards
kumar
closing the thread
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Palnati
Check my reply to this thread
You can try using this Unix bash script
:
# Input: lines containing thre fields separated by white spaces
TAR_DIR=/tmp/data # The path name of the target directory
# Create the target directory if necessary
[ -d $TAR_DIR ] || mkdir $TAR_DIR
# Clear the contents of the target directory
rm -rf $TAR_DIR/*
# Do it
while read N E1 E2; do
echo $N>>$TAR_DIR/$E1$E2 # Create or append
done <<!
condition1
condition2
!
make changes as per your need
Thanks
Gaurav
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.