awk and spaces in filenames

Hey there, this is my first post and I'll try to explain my situation as best I can.Here is a sample of the input file:

ADO Sample.h,v ADO Sample 2010-05-21 lyonsb /repository/patents/TSCommon/OpenSource/Dundass/ug6mfc/DataSources/Ado/ADO Sample
ADO SampleDoc.h,v ADO SampleDoc 2010-05-21 lyonsb /repository/patents/TSCommon/OpenSource/Dundass/ug6mfc/DataSources/Ado/ADO Sample
ADO SampleView.h,v ADO SampleView 2010-05-21 lyonsb /repository/patents/TSCommon/OpenSource/Dundass/ug6mfc/DataSources/Ado/ADO Sample
ChildFrm.h,v ChildFrm 2010-05-21 lyonsb /repository/patents/TSCommon/OpenSource/Dundass/ug6mfc/DataSources/Ado/ADO Sample
ConnectDlg.h,v ConnectDlg 2010-05-21 lyonsb /repository/patents/TSCommon/OpenSource/Dundass/ug6mfc/DataSources/Ado/ADO Sample
MainFrm.h,v MainFrm 2010-05-21 lyonsb /repository/patents/TSCommon/OpenSource/Dundass/ug6mfc/DataSources/Ado/ADO Sample
MyCUG.h,v MyCUG 2010-05-21 lyonsb /repository/patents/TSCommon/OpenSource/Dundass/ug6mfc/DataSources/Ado/ADO Sample
SqlEditDlg.h,v SqlEditDlg 2010-05-21 lyonsb /repository/patents/TSCommon/OpenSource/Dundass/ug6mfc/DataSources/Ado/ADO Sample
StdAfx.h,v StdAfx 2010-05-21 lyonsb /repository/patents/TSCommon/OpenSource/Dundass/ug6mfc/DataSources/Ado/ADO Sample

As you can see there are filenames and directories with spaces in them.
I need to format this file, in order to upload to a DB2 database, therefore each field had to be set to a specific character length, which I have accomplished using the following awk line:

awk '{ printf "%70-s %70-s %10-s %10-s %200-s\n", $1, $2, $3, $4, $5}'

This works, but not for the lines that have spaces in filenames or directories.

Any help would be much appreciated.If you need more info just let me know.

Here is the main line in my script

more $SCRIPTPATH/Techsource_CVS_Search.out | awk '{ printf "%70-s %70-s %10-s %10-s %200-s\n", $1, $2, $3, $4, $5}' > $SCRIPTPATH/Techsource_CVS_Search.txt

Thanks

Rodan

Can you post the desired output between code tags?

The desired outout would be similar to the input file but with specific character lengths.

Here is the first line:

ADO Sample.h,v ADO Sample 2010-05-21 lyonsb /repository/patents/TSCommon/OpenSource/Dundass/ug6mfc/DataSources/Ado/ADO Sample

When I run the awk line, it outputs it like this

ADO                                        Sample.h,v                 ADO          Sample                                       2010-05-21                 lyonsb          lyonsb /repository/patents/TSCommon/OpenSource/Dundass/ug6mfc/DataSources/Ado/ADO Sample

This is just an example I didn't use the actual character length, however the ouput I'm looking for would be this:

ADO Sample.h,v                                  ADO Sample                      2010-05-21  lyonsb      /repository/patents/TSCommon/OpenSource/Dundass/ug6mfc/DataSources/Ado/ADO Sample

I hope this makes sense, basically the awk line will look at this first field, which is $1, and treat the spaces as spaces, therefore $2 ends up being part of the filename and not the actual second field, and the last field $5 gets truncated.

try with this one

 awk '{ printf "%s %70-s %s %10-s %s %10-s %s\n", $1, $2, $3, $4, $5, $6, $7}' input_file