473,396 Members | 1,786 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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
2 1420
numberwhun
3,509 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
4,059 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

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

Similar topics

7
by: Ryan Swift | last post by:
Hi, I'm new to Python, so this may be an easy solution. I'm having trouble extracting TIFF files from incoming emails. Actually, I think the root of my problem is that I'm having trouble reading...
2
by: Konstantin Zakharenko | last post by:
Hello, Our QA team have running a lot of test scripts (for automated regression testing), they run them on the different databases (Oracle/MS SQL). Several of those tests are dependent on the...
3
by: wenz | last post by:
Hi I have an exe which is actually a self-extracting zip file that i would like to run to extract all the files. I have the code showing how to use the j# classes and library to extract zip files...
1
by: Mark Jones | last post by:
Can anyone point me towards information/.net components that can be used for text extraction and pattern recognition? In particular, I am interested in working with a screenshot and extracting...
5
by: b83503104 | last post by:
Hi, I have a bunch of strings like a53bc_531.txt a53bc_2285.txt .... a53bc_359.txt and I want to extract the numbers 531, 2285, ...,359. One thing for sure is that these numbers are the...
18
by: noridotjabi | last post by:
Whilest I was browesing a tutorial today I came across the infromation that in standard C variables must be decalred at the beginning of a block. Meaning: ...
4
by: Rex | last post by:
I want to find out as much as I can using JavaScript about the user's browser and possible about the user himself or herself. is there a good guide anywhere on the Internet that explains what...
4
by: Damo | last post by:
I have a program, That retrieves a webpage , such as a search engine results page from the web, Then I need to go through the document and retrieve just the search results. The problem is I want to...
5
by: Mukesh | last post by:
Hi, I am using framework 2.0. I am writing a foreach loop that will extract single dimensional arrays out of double dimensional array. I am trying writing something like this. string ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.