Operating System - HP-UX
1752786 Members
5821 Online
108789 Solutions
New Discussion юеВ

How to devide one file to become two file

 
SOLVED
Go to solution
suryaj
Occasional Contributor

How to devide one file to become two file

I want to divide file Xx010801.SOL that has certain format to become file Header.txt and Line.txt that also have certain format.Can any one help me to resolve this problem??I have
attached all of files above.
Surya
3 REPLIES 3
harry d brown jr
Honored Contributor

Re: How to devide one file to become two file

If you or someone in your company knows perl you/they can accomplish this quite easily.
Live Free or Die
Praveen Bezawada
Respected Contributor

Re: How to devide one file to become two file

Hi
It looks complex , but as an example of what can be done I am appending a short script. This is for generating line.txt

#! /sbin/sh

awk '{ if ( $1 ~ /PCODE/ ){
print $1";"$2";"....
}
else if ( $3 ~ /KRT.*/ ) {
print count";"$1";"$2...
}
}' INPUTFILE > OUTPUTFILE

The point is to search for the required pattern and then display the results in the format you require..
Hope this helps....

...BPK...
harry d brown jr
Honored Contributor
Solution

Re: How to devide one file to become two file

Try this
Live Free or Die