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
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.
something like this
my @arr = split(/\|/);
for( my $i = 0; $i < $#arr; $i++ ) {
if ( $i <= 240 ) {
<print in to the current file>
}
else {
<print another file>
}
}
Can you please give a clear code. Thank you
you can use Spreadsheet::WriteExcel module in perl to create well formatted excel sheets.