Thanks Ygor for the quick reply. Sorry, I did not understand the solution. I copied my test files in to a nad b files. I tried executing the above code on command line but got this error.
**********************
"}awk: There is a regular expression error.
?, *, or...
Hi, I have two files with the same format. Each of these files are | delimited and have a record identifier.
1 header, 2 detail, 3 trailer.
In the out put file:
I need to have the header of file a, merge the detail records of two files and sum up the corresponding trailer values of these two...
Hi. I was wondering if I could fix the problem I have with my previous message in a different way. I'm sorry for multiple threads, I'm a newbie to both unix and awk and do not even have a awk book to refer.
I'll repeat the whole issue again...
Here is my script.
********************************************************
test.ksh
for i in $dir
do
test.awk i > $dir/(basename i)_C
done
**********
test1.awk
BEGIN{OFS=FS="*"}
/QR/{
for (j=1;j<=NF-7;j++) {
if ($j ~ /QR/ && $(j+1)=="XA")...
Hi I'm very new to unix and awk. here is what I want.
For ex: In input file FILE, * is the delimiter
If the file is :
ABC*12*avxcgju932*00**123*12345678iouyt*18*123nhtrkw...
Hi, I'm very new to unix shell scripting. Need some help. I have to loop through a few files in a directory.
for i in $files
do
awk -f test.awk $i
done
If my directory is /X how do I assign files to?
files= ?
TIA
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.