473,750 Members | 2,225 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

read tables from txt files

1 New Member
I have a lot of files that have the same below format in different folders and I need to parse these files and add them in one file :

X1 = 1
X2 = 2
X3 Y1 Y2
0.005 0.047539 0.029597
0.362143 0.078621 0.0087323

What I need to do is to write the above data in diferent format like that:
X1 X2 X3 Y1 Y2
1 2 0.005 0.047539 0.029597
1 2 0.005 0.047539 0.029597
1 2 0.362143 0.078621 0.0087323
1 2 0.362143 0.078621 0.0087323

Also some files contain more than 3 Xs and More than 2 Ys
So what I need is to 1st find these files which have the same name xxx.txt and parse the files by adding the variables in variable names and add the tables in arryes then write them in the format I need
I am new in PERL so any help will be appreciated
Aug 15 '12 #1
0 1189

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

Similar topics

5
3505
by: Manavendra Gupta | last post by:
Hi Can anyone provide an example of how to modify read-only files in java? Thanks M
4
3065
by: googlinggoogler | last post by:
Hiya, The title says it all really, but im a newbie to python sort of. I can read in files and write files no probs. But what I want to do is read in a couple of files and output them to one single file, but then be able to take this one single file and recreate the files I put into it. Im really at a loss as to how I go about recovering the files?
1
1567
by: Pranav Bagora | last post by:
Hello, I am getting a permission Denied error when i am trying to make changes in some read only files in a directory. How do we check and change the read only attributes of files in python. Please Help, Pranav
2
1435
by: Michael A. Covington | last post by:
I want to deploy a project in which the user is provided with a set of READ-ONLY files to use as templates. They will be in a directory to which the user can add files of his own. It's important to keep the user from deleting any of the pre-supplied files, because if this is done, the Windows Installer apparently wants to "repair" the application. I didn't realize it kept track of such things, but it's doing so. How can I make the...
2
2626
by: ViperCB | last post by:
Hello from a newbie, I am trying to do some research on an upcoming project that involves reading in audio files of various formats and using the audio signal as a source of noise to generate pretty pictures. (like windows media player visual plugins. I will be developing in C++ and was wondering if there are any packaged libraries out there that I can use to read audio files encoded in different formats and lets me easily access the...
2
9987
by: hzgt9b | last post by:
Using VB .NET 2003, I need to delete some read-only files. I tried using System.IO.File.Delete(filename) - but when the files are read-only, I get error messages stating that I don't have proper access... So, what's the best way to delete a read-only file programmatically? Any help would be greatly appreciated!
0
1064
by: Ivt22 | last post by:
hi, if someone can help me how can i read all files form a CD one by one and from each file extract all tables in the file once the file ends go and open the next file and on and on... until the last file in the CD. I can do it for one file and the extraction of a table too, so , if anybody can help me... thanks,
7
5650
by: Frank | last post by:
Years ago I wrote a program to read .lnk files, modify the data and rewrite the file. I modified it slightly and used it for .pif files. I can't find it nor can I find the API calls I used. Can you direct me to some info on this subject?
0
1264
by: kdsutaia | last post by:
hi! I hv to read two files from two diff directories and need to count pairs of words from both the files. as well I hv to keep track of no of documents where this terms present. All files are .xml files.. I am reading using saxparser. I was thinking using hashtable where keys are pair words and value will be the vector which contains word freq and doc freq. can any one suggest better approch then this. Secondly, How do i read two...
1
4912
by: svchosthunter | last post by:
I using the follwing code to read DOC files but when i try to read pdf files it didnt work How can I read pdf files ? Dim fs As New FileStream(SaveLocation, FileMode.Open, FileAccess.ReadWrite) Dim s As New StreamWriter(fs) Dim d As New StreamReader(fs) d.BaseStream.Seek(0, SeekOrigin.Begin) While d.Peek() > -1 Me.txtbox1.Text &= d.ReadLine() txt_PageContents.Text &= d.ReadLine() ...
0
8838
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9577
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
9396
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9339
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8260
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...
1
6804
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4713
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...
1
3322
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
2804
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.