By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,841 Members | 1,372 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,841 IT Pros & Developers. It's quick & easy.

Naming a file based on its contents.

P: 1
I need to read in a file, and, on the outbound side, name it based on the contents of the file. For instance, if there is text in the file that looks like this: OBX|1|TX|NN^ I want to name the file NN_021220081430. If the text looks like this: OBX|1|TX|CON^ I want to name the file CON_021220081430. Can someone help me out?
Feb 12 '08 #1
Share this Question
Share on Google+
1 Reply


eWish
Expert 100+
P: 971
You would want to read the file line by line, then split on the delimiter '|' and use the 4th element for the first part of the name. Then save the file to the location of your choice. I am not sure where you are getting 021220081430 from. Can you provide some better sample data as well as what you have tired, so that we may help you?

--Kevin
Feb 12 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.