Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change Date Format in fixed width text file

Status
Not open for further replies.

sxschech

Technical User
Jul 11, 2002
1,033
US
Was wondering how to change the date format in a text file by changing a 3 character Month
"OCT"
to a two digit month with a leading 0
"010".

Example:
[tt]
DDMMMYYYY 01OCT2009
change to
DDMMMYYYY 01[red]0[/red]102009
[/tt]
The text file is fixed width and the position of the date portion starts on col 104 ends at col 112 and size is 9. Total of all fields col ends at 427. After changing the date, the field length/position should not have changed.

The file is received via a download from a website and then is then uploaded to our server via FTP. The source file needs to be downloaded and FTP'd at least once a day, so this is not a one time event. Can the process be automated somehow.

Apologies if this is not the best forum to post this particular question.
 
Have a look at the Mid and Replace functions.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top