Hi:is there a command that will let me append a file to another file after processing the first file?i assume that it will do one record(line at a time).I have checked the sed & awk book and see no append in AWK.thank you.
see no append in AWK
Which book ?
No explanation of the difference between print > and print >> ?
You may also do a man tee paying attention to the -a option.
Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
PHV: I have sed & awk published by oreilly.In the index the only reference to append is "append command(see A command (sed)).P.S. this is the second edition.also,i had another post concerning the -F option in this book and cakiwi responded by citing pages in the same book which referenced
the -F command.however,in my post i had said that the only
way i could get the -F command to work was to use -F: after seeing the same used in the knoppix linux software.he intimated that i had set the FS to :I did not.the FS was
"\n" BUT would only work if -F: was used.i am confused and feel perhaps there are numerous versions of awk,nawk,gawk etc.i had written to the publisher and was told that there were numerous versions of awk????? Can you please tell me of a reliable version.i appreciated the 'man tee' advice but
am unable to utilize same any further embellishment?thank you.
If you just want to stick file b onto the end of file a, would this not work?
cat b >> a
[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
BEGIN {f1 = ARGV[1]} #store first input filename
FILENAME == f1 {printf "%d: %s\n", NR, $0; next} # process first file
{print $0} # just print second file
Mike: thanx for your input.I have to investigate further
because i am not in a unix mode.i am in a windows/dos mode
and it is PECULIAR.i used M.GAGNE linux via a cd and problems that i have in WIN98SE go away with linux.stay tuned!!
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.