473,785 Members | 2,466 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Extracting specific variables from a fixed-width data file

1 New Member
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 1446
numberwhun
3,509 Recognized Expert Moderator Specialist
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 Recognized Expert Specialist
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
1859
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 the email header. Does anyone have an easy solution? Thanks in advance.
2
8752
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 current date/time. In order to be able to use them efficiently, we changed the current date/time on the QA database server to a specific date/time before starting the scripts, so we are sure the test scripts always run in the same environment.
3
5514
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 however it looks like these work on zip files only, not exe. Does anyone know how to get around this? I would like to do it all without having any user input. Using process.start() works however this asks the user where to extract the files...
1
1463
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 text and identifying specific icons on the screenshot. I believe that Leadtools has some nice libraries but they are expensive. I also don't need all of the scanning/TWAIN support as my images will already be in raster format. Any help/pointer...
5
2301
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 ONLY part that is
18
3231
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: /****************************************************/ /* ... usual includes and such */ int var = 1; if(var = 1){ printf("hello world\n");
4
1846
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 information can be extracted using JavaScript? on various web pages I see short mentions of variables such as document.referrer and browser.name as I have yet to find a comprehensive listing of these variables. Can someone please point me to a...
4
1694
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 omit the sponsored results. So is there a way I can start analysing the document at a specific point (ie after the sponsored results) Thanks
5
3647
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 strDetails foreach(string str in strDetails) { //Code comes here }
0
10356
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9958
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8986
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5390
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5523
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4058
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3662
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2890
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.