Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^4: Split a large text file by columns

by Anonymous Monk
on Apr 22, 2017 at 05:54 UTC ( [id://1188602]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Split a large text file by columns
in thread Split a large text file by columns

I see what you're trying to do, almost

How do you decide what filename gets what columns?

Based on your sample data, these are two rows (headers then rows) that go into three files , this is how you're wanting to split that up

<GSOR> vnir_1 vnir_2 vnir_3 <GSOR> vnir_4 vnir_5 vnir_6 <GSOR> vnir_7 vnir_8 vnir_9

This is the first data row split up and ready to end up in three different files

310015 0.37042 0.36909 0.36886 310015 0.36698 0.36615 0.36449 310015 0.36404

What is the filename for the first 3 columns? Second 3 columns? Last "3" columns? And this is repeated for every row in the original data?

Replies are listed 'Best First'.
Re^5: Split a large text file by columns
by tc (Novice) on May 01, 2017 at 21:44 UTC

    Hi, I have been out of town for awhile and did not check the forum. That is the way that I would like the to be split. Ideally, the file names would be in a sequential order to make it simple. As long as each column has a header, the file name does not matter. Yes, it will be repeated for every row in the original data. The row numbers change from file to file as well as the column numbers.

    The solutions offered by Marshall and Kevbot did the trick. Thank you for your assistance.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1188602]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (5)
As of 2024-04-16 16:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found