From: Jan Svitok Date: 2007-02-04T08:19:12+09:00 Subject: Re: Manipulating CSV files over SSH On 2/3/07, Drew Olson wrote: > All - > > I have a nice little script that takes a large CSV document and splits > it into 65,000 line chunks which are readable in Excel. However, I > currently have a .csv file which I'd like to split that is sitting on a > unix box. I have ssh access to the box, however the file is quite big > and I'd like to avoid downloading the whole file. Is there a simple way > to modify my script such that I use the ssh library to access the > document and perform the splitting over the network? > > Thanks in advance, > Drew The natural way would be to upload the script there and run it on he remote host, provided that ruby is installed on the host. If you don't need CSV escaping, (embedded newlines etc.) then using split(1) should be enough, i.e. split -l 65000 filename prefix for alphanum counter and split -l 65000 -d filename prefix for numerical one.