DCrake
Remembered
- Local time
- Today, 16:04
- Joined
- Jun 8, 2005
- Messages
- 8,626
Code:
Do While Not EOF(1)
Line Input #1, strLine 'read the incoming line from the SourceFile
If nIndex > 0 Then 'Do not do anything with the first line - this contains the column headings
>>> Insert Here
Print #2, Replace(strLine, "_", ",") 'Replace all underscores with commas to act as delimiters and write to the TartgetFile
End If
nIndex = nIndex + 1 'Prevent from skipping the next line of data
Loop
The code will need to be inserted as a function here. I have not got enough time or the inclination at present to write it as we are not here to offer full blown solutions, mainly pointers to enable you to reach a solution.
As explained previously once you find out how many words they are in the first field you need to decide which word will og into which field. For example if the field was
FRANCE_FRA_CUST_ORDER would yield FRANCE,FRA,CUST,ORDER
Whereas
FIN_CASHCOLLECTIONS would yield FIN,CASHCOLLECIONS,,
As you need to ensure that nomatter how many underscores you started with you need to ensure you have the at the end. Why? so that the fifth field ( the date field) goes into the date field, if you don't everything will be truncated and missaligned.
David