Advertisement

07.22.2008 at 02:56AM PDT, ID: 23584555
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.0

AIX scripts to split a file in to multipule files depending on matching patteren without any chages to exiting data in file?

Asked by deepak_tyco in KornShell (ksh)

Tags: ,

Hi,
I have a requirement to split the file on different pattern and write to different files.
My scripts doing the work properly but i am facing a strange problem. while writing to different files the white space at the end of the each line is trimming.
That means if the original line in the file is 339 chars ; its trimming to 239 char in new file by trimming the white spaces in the end of the line ; which i dont want.

my scripts is as below:-

#!/usr/bin/ksh
#Mtv extract file directory
MTVFSDIR="D:/home/dsadm"
MTVFTPDIR="$MTVFSDIR/inbound/mtv"
#Mtv extract log directory
MTVLOGSDIR="$MTVFSDIR/log"
#Mtv stag folder directory
MTVSTAGEDIR="$MTVFSDIR/stage/mtv"
MTVLOG=$MTVLOGSDIR/$1".MTVEXTRACT.LOG."$CURRDATESTAMP
MTVARCH="$MTVFSDIR/archive"

# Spliting of file start

echo "spliting start"

         while read Line
          do
            match_char=`echo $Line | cut -c1-4`
              echo $match_char
              if test $match_char -eq 0001
             then
             echo "$Line"  >> $MTVSTAGEDIR/stage_header.txt
               elif test $match_char -eq 0004
               then
                 echo "$Line"  >> $MTVSTAGEDIR/stage_bl_header.txt
             elif test $match_char -eq 0010
               then
                 echo "$Line"  >> $MTVSTAGEDIR/stage_invoice.txt
             elif test $match_char -eq 0020
                    then
                 echo "$Line"  >> $MTVSTAGEDIR/stage_contact_detail.txt
             elif test $match_char -eq 0030
               then
             echo "$Line"  >> $MTVSTAGEDIR/stage_cash_detail.txt
             elif test $match_char -eq 0040
               then
                 echo "$Line"  >> $MTVSTAGEDIR/stage_adj_detail.txt
             elif test $match_char -eq 0050
               then
                 echo "$Line"  >> $MTVSTAGEDIR/stage_message.txt
             elif test $match_char -eq 0060
               then
                 echo "$Line"  >> $MTVSTAGEDIR/stage_corresp.txt
             elif test $match_char -eq 0070
               then
                 echo "$Line"  >> $MTVSTAGEDIR/stage_department.txt
             elif test $match_char -eq 0080
               then
                 echo "$Line"  >> $MTVSTAGEDIR/stage_broker.txt
               elif test $match_char -eq 1000
               then
                 echo "$Line"  >> $MTVSTAGEDIR/stage_component.txt
             elif test $match_char -eq 1100
               then
                 echo "$Line"  >> $MTVSTAGEDIR/stage_component_rider.txt
             elif test $match_char -eq 1200
               then
                 echo "$Line"  >> $MTVSTAGEDIR/stage_contract_summary.txt
               else
              echo "$Line"  >> $MTVSTAGEDIR/stage_reject.txt
            fi

          done < $MTVFTPDIR/ABE.txt

echo "Spliting of file end"



STAMP=`date +%Y-%m-%d:%H-%M-%OS`

echo "Job Completed !!!..."

#everything goes well, exit with 0



Can any body help me out..

Thanks
deepak

Start Free Trial
 
Loading Advertisement...
 
[+][-]07.22.2008 at 05:43AM PDT, ID: 22058674

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.22.2008 at 07:00AM PDT, ID: 22059407

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.22.2008 at 09:28AM PDT, ID: 22061063

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.22.2008 at 08:45PM PDT, ID: 22065820

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: KornShell (ksh)
Tags: AIX - shell scripts, AIX5.3
Sign Up Now!
Solution Provided By: Tintin
Participating Experts: 2
Solution Grade: A
 
 
[+][-]07.22.2008 at 08:47PM PDT, ID: 22065823

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.23.2008 at 02:22AM PDT, ID: 22067339

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.23.2008 at 02:58AM PDT, ID: 22067491

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.23.2008 at 03:06AM PDT, ID: 22067525

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.23.2008 at 03:16AM PDT, ID: 22067575

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.23.2008 at 03:51AM PDT, ID: 22067746

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.23.2008 at 04:12AM PDT, ID: 22067849

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-42 / EE_QW_2_20070628