473,700 Members | 3,078 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 1186

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

Similar topics

5
3500
by: Manavendra Gupta | last post by:
Hi Can anyone provide an example of how to modify read-only files in java? Thanks M
4
3055
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
1563
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
1432
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
2622
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
9981
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
1062
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
5649
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
1263
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
4909
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
8712
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8639
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
9203
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...
1
8952
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
7794
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
5895
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
4395
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
4649
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2018
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.