By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,474 Members | 939 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,474 IT Pros & Developers. It's quick & easy.

read tables from txt files

P: 1
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
Share this question for a faster answer!
Share on Google+

Post your reply

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