467,179 Members | 1,196 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,179 developers. It's quick & easy.

Extracting specific variables from a fixed-width data file

Hi,

I have 125 unique variables and corresponding values in a data file with 6 fixed-width columns (columns alternate between "variables" and "values"). If I only need 6 of these variables and their values, which are scattered throughout the file, what are some suggestions to put into my script in order to extract them and them only? Is there a way to locate specific keys and ignore the others?

Thanks for your help!
Jul 3 '08 #1
  • viewed: 1256
Share:
2 Replies
numberwhun
Expert Mod 2GB
Can you provide a sample of the data and re-explain, using that sample, exactly what you are looking for?

Regards,

Jeff
Jul 3 '08 #2
KevinADC
Expert 2GB
Hi,

I have 125 unique variables and corresponding values in a data file with 6 fixed-width columns (columns alternate between "variables" and "values"). If I only need 6 of these variables and their values, which are scattered throughout the file, what are some suggestions to put into my script in order to extract them and them only? Is there a way to locate specific keys and ignore the others?

Thanks for your help!
for fixed-width records unpack is the most efficient function. You can also use substr. You can look both of those perl functions up online or in your local perl documentation.
Jul 3 '08 #3

Post your reply

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

Similar topics

7 posts views Thread by Ryan Swift | last post: by
3 posts views Thread by wenz | last post: by
1 post views Thread by Mark Jones | last post: by
5 posts views Thread by b83503104@yahoo.com | last post: by
18 posts views Thread by noridotjabi@gmail.com | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.