473,378 Members | 1,218 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,378 software developers and data experts.

Tab limited file manipulation in PERL

Hai i have a tab limited file (see the attachment 1.xls) and i want to extract only 2,7,8 columns(2.xls) how it possible with a perl code
Attached Files
File Type: xls 1.xls (376 Bytes, 208 views)
File Type: xls 2.xls (98 Bytes, 188 views)
Sep 17 '16 #1
1 3002
RonB
589 Expert Mod 512MB
Open a read filehandle to the source file and a write filehandle to the output file.

Loop over the source file line-by-line and use the split() function to put the fields into an array and then output the desired 3 array elements to the output filehandle.

There are several variations on how to do each step and there are modules available, such as Text::CSV_XS, to help but using the module would not be required.
Sep 17 '16 #2

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

Similar topics

0
by: harshan | last post by:
Hi I am trying to read required worksheet from excel file using perl with module spreadsheet::parseexcel and spreadsheet::writeexcel but I am unable to read it, the error I am getting is...
1
by: ma740988 | last post by:
Trying to some of my reading on file manipulation (ifstream/ofstream/fstream) into action. So now consider. # include <iostream> # include <fstream> # include <cstring> # include <sstream> ...
2
by: PFI | last post by:
Hi, I recently installed SQL Server 2005 Enterprise Edition (9.0.1399) and I have problems on queries concerning system file manipulation... For example, when I try to increase the Log File of...
4
by: magix | last post by:
Dear Guru, I'm not so good in file manipulation, but would like to seek for help here. I have following basic code of command line argument as starting point (the code below output the...
1
by: Kriston Scott | last post by:
I would like to know how to sort the rows in an Excel file, using Perl.
1
by: prashantkuppa | last post by:
please help me anyone, here i am struck up with extracting check box status from pdf file using perl please give anybody some suggestions its urgent thanks prashant
5
by: bhavanirayala | last post by:
Hello All, I am very new to perl.I am a java person. I have to read xml file in perl script and use those values in that file. So can anybody please help me to solve this xml parsing in perl...
5
by: chitralaxman | last post by:
i am in need to run an .exe file from perl script and that exe file should accept an input from another file. please give me the solution to run an exe file from perl script
11
by: dawood munavar | last post by:
I have the size of a text file (say 1MB) and i have the location to save the text file (say C:/) , how do i create a file in perl which should be 1MB size and which should save in C:/. Give me some...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.