Greetings all....not sure how I want to do the following task, so I'd like some input:
I have a 'fixed length' data file that looks like this:
John Robert Doe 1234 Main St
Robert Smith 9876 Elm Ave
William C Tennant Jr 1111 Walnut Rd
The output I need is an ASCII comma-delimmited file like:
"John","Robert","Doe","1234 Main St"
"Robert",,"Smith","9876 Elm Ave"
"William","C","Tennant, Jr","1111 Walnut Rd"
NOTE: ALL of the first four (4) fields are 20 characters
long. IF the second field is blank (middle name/initial),then obviously the delimmited file needs to account for that with the 'extra comma' between fields 1&2
i.e. "Robert",,"Smith" <--- no middle name/init
Also, IF field 4 contains any record, it is the "Jr/Sr" field, so I need it to 'append' to the third field (last name)
Any suggestions on what would be easiest? I have played a bit with each of them but can't seem to get it to work correctly for each instance and each record??
thanks for everyone/anyone's help
scooter6
I have a 'fixed length' data file that looks like this:
John Robert Doe 1234 Main St
Robert Smith 9876 Elm Ave
William C Tennant Jr 1111 Walnut Rd
The output I need is an ASCII comma-delimmited file like:
"John","Robert","Doe","1234 Main St"
"Robert",,"Smith","9876 Elm Ave"
"William","C","Tennant, Jr","1111 Walnut Rd"
NOTE: ALL of the first four (4) fields are 20 characters
long. IF the second field is blank (middle name/initial),then obviously the delimmited file needs to account for that with the 'extra comma' between fields 1&2
i.e. "Robert",,"Smith" <--- no middle name/init
Also, IF field 4 contains any record, it is the "Jr/Sr" field, so I need it to 'append' to the third field (last name)
Any suggestions on what would be easiest? I have played a bit with each of them but can't seem to get it to work correctly for each instance and each record??
thanks for everyone/anyone's help
scooter6