Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Hi, I am stuck on the following issue with awk and need help. I currently have data that looks like this:
Directory of /home/admin/slap/test
06/09/2009 08:15 AM 954,880 bin.fla
02/09/2009 09:48 AM 173,905 bin.swf
03/23/2009 11:04 AM 2,168 bin.xml
06/09/2009 08:15 AM 830,464 dnd.fla
02/05/2009 12:47 PM 175,001 dnd.swf
02/05/2009 11:13 AM 1,835 dnd.xml
06/09/2009 08:15 AM 755,712 mcq.fla
06/09/2009 08:15 AM 46,843 mcq.swf
06/09/2009 08:15 AM 2,706 mcq.xml
Directory of /home/admin/slap/test2
06/09/2009 08:16 AM 954,880 bin.fla2
02/09/2009 09:47 AM 173,905 bin.swf2
03/23/2009 11:04 AM 2,168 bin.xml2
06/09/2009 08:17 AM 830,464 dnd.fla2
02/05/2009 12:48 PM 175,001 dnd.swf2
02/05/2009 11:10 AM 1,835 dnd.xml2
06/09/2009 08:16 AM 755,712 mcq.fla2
06/09/2009 08:14 AM 46,843 mcq.swf2
06/09/2009 08:12 AM 2,706 mcq.xml2
I need to somehow run through this file and extract out "Directory of /home/admin/slap/test" and append it to each file in the 5th field.
So the end result would be something like:
Directory of /home/admin/slap/test/bin.fla
Directory of /home/admin/slap/test/bin.swf
Directory of /home/admin/slap/test/bin.xml
for each block of text. So the next block would be
Directory of /home/admin/slap/test2/bin.fla2
Directory of /home/admin/slap/test2/bin.swf2
Directory of /home/admin/slap/test2/bin.xml2
Not sure if awk would be the right tool or if this is even possible. Any advice would be great. This was a originally a directory list of all files and we need to somehow reconstruct back to a full directory listing.