Sponsored Content
Top Forums Shell Programming and Scripting sed cannot execute [Argument list too long] Post 302897778 by galaxy_rocky on Wednesday 16th of April 2014 01:46:50 AM
Old 04-16-2014
Hi ygemici, I am trying to implement your suggestions and i have made couple of changes to my script to use while loop and read from file.
But i am stuck in the below section:
Code:
cat missing_$line_${tmp_file_suffix}i.dat | while read line
do

echo "<Row>" >> excel_${tmp_file_suffix}i.dat
echo $line | awk -F';' '{print("<Cell><Data ss:Type=\"String\">"$1F"</Data></Cell>")}' >> excel_${tmp_file_suffix}i.dat
echo $line | awk -F';' '{print("<Cell><Data ss:Type=\"String\">"$2F"</Data></Cell>")}' >> excel_${tmp_file_suffix}i.dat
echo $line | awk -F';' '{print("<Cell><Data ss:Type=\"String\">"$3F"</Data></Cell>")}' >> excel_${tmp_file_suffix}i.dat
echo $line | awk -F';' '{print("<Cell><Data ss:Type=\"String\">"$4F"</Data></Cell>")}' >> excel_${tmp_file_suffix}i.dat
echo $line | awk -F';' '{print("<Cell><Data ss:Type=\"String\">"$5F"</Data></Cell>")}' >> excel_${tmp_file_suffix}i.dat
echo $line | awk -F';' '{print("<Cell><Data ss:Type=\"String\">"$6F"</Data></Cell>")}' >> excel_${tmp_file_suffix}i.dat
echo $line | awk -F';' '{print("<Cell><Data ss:Type=\"String\">"$7F"</Data></Cell>")}' >> excel_${tmp_file_suffix}i.dat
echo $line | awk -F';' '{print("<Cell><Data ss:Type=\"String\">"$8F"</Data></Cell>")}' >> excel_${tmp_file_suffix}i.dat
echo $line | awk -F';' '{print("<Cell><Data ss:Type=\"String\">"$9F"</Data></Cell>")}' >> excel_${tmp_file_suffix}i.dat
echo $line | awk -F';' '{print("<Cell><Data ss:Type=\"String\">"$10F"</Data></Cell>")}' >> excel_${tmp_file_suffix}i.dat
echo $line | awk -F';' '{print("<Cell><Data ss:Type=\"String\">"$11F"</Data></Cell>")}' >> excel_${tmp_file_suffix}i.dat
echo $line | awk -F';' '{print("<Cell><Data ss:Type=\"String\">"$12F"</Data></Cell>")}' >> excel_${tmp_file_suffix}i.dat
echo $line | awk -F';' '{print("<Cell><Data ss:Type=\"String\">"$13F"</Data></Cell>")}' >> excel_${tmp_file_suffix}i.dat
echo "</Row>" >> excel_CT_${tmp_file_suffix}i.dat
done
echo "</Table>" >> excel_${tmp_file_suffix}i.dat
echo "</Worksheet>" >> excel_${tmp_file_suffix}i.dat
done
echo "</Workbook>" >> excel_${tmp_file_suffix}i.dat

the above section basically echoes the contents of file and sets up the excel file to be created. Any suggestions on this?

Regards,
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Argument list too long - SSH

Hi I executed the code for file in `ls pdb*.ent` do new_name=`echo $file | sed 's/^pdb//;s/.ent/.txt/'` mv $file $new_name done Its giving error at ' ls pdb*.ent' argument list too long i have around 150000 entries please help Thank you (6 Replies)
Discussion started by: empyrean
6 Replies

2. Shell Programming and Scripting

Argument too long list error

I have a wrote a script which consits of the below line.. Below of this script I'm getting this error "ksh: /usr/bin/ls: arg list too long" The line is log_file_time=`ssh -i $HOME/.ssh/id_rsa -q $i ls -lrt /bp/karthik/test/data/log/$abc*|tail -1|awk '{print $8}'` And $abc alias is as "p |... (1 Reply)
Discussion started by: 22karthikreddy
1 Replies

3. UNIX for Dummies Questions & Answers

Argument list too long for Sed command

Hi guys Following command results in sed -i 's/#/\\#/g' /home/test/sqlstents* -bash: /bin/sed: Argument list too long Please help me solve it.. is there any other way i can do this?.. thanks (4 Replies)
Discussion started by: depakjan
4 Replies

4. Shell Programming and Scripting

Argument list too long problem

I have a huge set of files (with extension .common) in my directory around 2 million. When I run this script on my Linux with BASH, I get /bin/awk: Argument list too long awk -F'\t' ' NR == FNR { a=NR } NR != FNR { sub(".common", "", FILENAME) print a, FILENAME, $1 } '... (1 Reply)
Discussion started by: shoaibjameel123
1 Replies

5. Shell Programming and Scripting

Argument list too long for date command

Dear Friends, The following script processes a 14508 lines log file. #!/bin/sh while read line do d=`sed 's/* - * \*\/*\/* *\)\] .*/\1/' | tr '/' ' ' | sed 's/\(*\):\(*\)/\1 \2/'` y=`date -d "${d}" "+%Y%m%d%H%M%S"` echo "${y}" done While running the above script, I am... (4 Replies)
Discussion started by: tamil.pamaran
4 Replies

6. Shell Programming and Scripting

Argument list too long!!

Dear Experts, I have a list of 10K files in a directory. I am not able to execute any commands lile ls -lrt, awk, sed, mv, etc........ I wanna execute below command and get the output. How can I achieve it?? Pls help. root# awk -F'|' '$1 == 1' file_20120710* | wc -l /bin/awk: Argument list... (2 Replies)
Discussion started by: Naga06
2 Replies

7. Shell Programming and Scripting

grep : Argument list too long

Hi, i am having some trouble with the below command, can some one suggest me the better way to do it. grep -l 'ReturnCode=1' `find $Log -newer /tmp/Failed.tmp -print | xargs ls -ld | egrep SUB | egrep -ve 'MTP' -ve 'ABC' -ve 'DEF' -ve 'JKL' -ve 'XYZ' | awk '{print $9}'` > $Home1 Its... (2 Replies)
Discussion started by: Prateek007
2 Replies

8. Shell Programming and Scripting

mv : Argument list too long

Hi I am using find command -- find "directory1" -type f | xargs -i mv {} "directory2" to avoid above argument list too long problem. But, issue i am facing is directory1 is having subdirectories due to this i am facing directory traversal problem as i dont want to traverse subdirectories... (9 Replies)
Discussion started by: VSom007
9 Replies

9. UNIX for Advanced & Expert Users

Argument list too long w/ sed

Hi all, I am using GNU sed (named gsed under macports) in OSX. I have a directory with a series of files named pool_01.jpg through pool_78802.jpg. I am trying to use this command to rename the files to their checksum + extension. md5sum * | gsed -e 's/\(*\) \(.*\(\..*\)\)$/mv -v \2 \1\3/e' ... (3 Replies)
Discussion started by: openthomas
3 Replies

10. Shell Programming and Scripting

Argument list too long

Hi Team, Here's the situation. I have approximately 300000 to 500000 jpg files in /appl/abcd/work_dir mv /appl/abcd/work_dir /appl/abcd/process_dir The above move command will work if the jpg files count is close to 50000 (not sure). If the count is less this mv command holds good. But if... (14 Replies)
Discussion started by: kmanivan82
14 Replies
GSL-HISTOGRAM(1)					      General Commands Manual						  GSL-HISTOGRAM(1)

NAME
gsl-histogram - compute histogram of data on stdin SYNOPSYS
gsl-histogram xmin xmax [n] DESCRIPTION
gsl-histogram is a demonstration program for the GNU Scientific Library. It takes three arguments, specifying the upper and lower bounds of the histogram and the number of bins. It then reads numbers from `stdin', one line at a time, and adds them to the histogram. When there is no more data to read it prints out the accumulated histogram using gsl_histogram_fprintf. If n is unspecified then bins of inte- ger width are used. EXAMPLE
Here is an example. We generate 10000 random samples from a Cauchy distribution with a width of 30 and histogram them over the range -100 to 100, using 200 bins. gsl-randist 0 10000 cauchy 30 | gsl-histogram -100 100 200 > histogram.dat A plot of the resulting histogram will show the familiar shape of the Cauchy distribution with fluctuations caused by the finite sample size. awk '{print $1, $3 ; print $2, $3}' histogram.dat | graph -T X SEE ALSO
gsl(3), gsl-randist(1). AUTHOR
gsl-histogram was written by Brian Gough. Copyright 1996-2000; for copying conditions see the GNU General Public Licence. This manual page was added by the Dirk Eddelbuettel <edd@debian.org>, the Debian GNU/Linux maintainer for GSL. GNU
GSL-HISTOGRAM(1)
All times are GMT -4. The time now is 02:17 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy