![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Adding columns to a file | figaro | UNIX for Dummies Questions & Answers | 5 | 07-20-2008 10:50 PM |
| add columns from file to another and sort | kamel.seg | Shell Programming and Scripting | 12 | 12-12-2007 11:39 AM |
| How can i replace certain columns in the file | mani_um | Shell Programming and Scripting | 6 | 06-22-2007 07:40 AM |
| how to get the columns name and fields from this file. | rnallamothu | Shell Programming and Scripting | 15 | 06-13-2007 05:14 AM |
| Appending columns on a file | abel | Shell Programming and Scripting | 2 | 09-27-2002 04:04 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
have a file with 300 columns
I am using awk to split the file to have 255 columns data in one file and rest in another file.
This is the script i am using awk -F"|" '{print > $240}' sourcefilename> targetfilename Since, I cannot import the data into excel sheet , as excel sheet accepts only 255 columns, I am trying to do this. Please help me in this matter where i am trying to insert a flat file with "$" as the delimiter into the excel sheet . But after 255 columns its truncating data.Please suggest me. Thanks in advance Last edited by dummy_needhelp; 11-02-2007 at 01:33 PM. |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
awk may not be able to do what you want, most awk implementations limit the number of fields there can be in a single record. Some have limits as low as 100 fields. And unix utilities all have limits as to the maximum line length.
Consult your awk man page. You may have to resort to perl or python. |
|
#3
|
|||
|
|||
|
something like this
Code:
my @arr = split(/\|/);
for( my $i = 0; $i < $#arr; $i++ ) {
if ( $i <= 240 ) {
<print in to the current file>
}
else {
<print another file>
}
}
|
|
#4
|
|||
|
|||
|
Can you please give a clear code. Thank you
|
|
#5
|
||||
|
||||
|
you can use Spreadsheet::WriteExcel module in perl to create well formatted excel sheets.
|
||||
| Google The UNIX and Linux Forums |