Sponsored Content
Top Forums Shell Programming and Scripting Cut command not working in for loop Post 302863731 by ctsgnb on Tuesday 15th of October 2013 04:20:10 AM
Old 10-15-2013
The error message is quite explicit : "No such file or directory"

Make sure that the file you are processing do exist and that you are in the right directory to process them.
Code:
cat file_GTDA.xls | grep 'GTDA_Dly_Sls_' | while read f
do ls -ld $f
done

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Use loop var i within Cut Command

Hi, In the following bash code rather than cutting at a predefined character I would like to cut at position i (i var from loop). Is this possible? I have tried eval, but either it's not possible or my syntax is wrong. thanks Nick for i in {1..9} do theChar=$(echo... (3 Replies)
Discussion started by: de_la_espada
3 Replies

2. UNIX for Dummies Questions & Answers

Cut not working in a loop

I have a function "MyPrint" that runs great on a file (BaseData.txt) that has one line of data. If i add rows to the text file it's reading the tFile variable becomes a list of every field 2 in the file. To correct this, i tried to call the function from a loop where i read one line at a time and... (4 Replies)
Discussion started by: KME
4 Replies

3. Shell Programming and Scripting

cut the present working directory

how to traverse through each directory (1 Reply)
Discussion started by: Reddy482
1 Replies

4. UNIX for Dummies Questions & Answers

cut not working the way i want it to

Hi Forum Im having problem with cut it even when i cut a field from an input file eg echo $x | cut -f1 -d':' it doesnt read the whole line if there is a space in it eg thisLineHasA SpaceInIt :wall: it only read up to the space.What i want is so the it cut the field as one line ... (8 Replies)
Discussion started by: ShinTec
8 Replies

5. Shell Programming and Scripting

Cut Command error cut: Bad range

Hi Can anyone what I am doing wrong while using cut command. for f in *.log do logfilename=$f Log "Log file Name: $logfilename" logfile1=`basename $logfilename .log` flength=${#logfile1} Log "file length $flength" from_length=$(($flength - 15)) Log "from... (2 Replies)
Discussion started by: dgmm
2 Replies

6. UNIX for Dummies Questions & Answers

Cut command, no input delim, output delim not working

Hello, I'm using cygwin on my Windows 7 machine. From the man pages of cut: --output-delimiter=STRING use STRING as the output delimiter the default is to use the input delimiter I tried the following commands and got the error messages: $ cut -c1-10,20-30 -d... (10 Replies)
Discussion started by: kojac
10 Replies

7. UNIX for Beginners Questions & Answers

Cut command: can't make it cut fields

I'm a complete beginner in UNIX (and not a computer science student either), just undergoing a tutoring course. Trying to replicate the instructions on my own I directed output of the ls listing command (lists all files of my home directory ) to My_dir.tsv file (see the screenshot) to make use of... (9 Replies)
Discussion started by: scrutinizerix
9 Replies

8. Shell Programming and Scripting

CUT command not giving correct result inside loop

Hi, i have a source file and have 3 columns and separated by "|" .i want to split this 3 columns in different variable.When i am executing this values indivisually giving correct result but when the same execute inside a for loop,it's giving issues. Src file(jjj.txt) -------... (8 Replies)
Discussion started by: raju2016
8 Replies

9. UNIX for Beginners Questions & Answers

Mv command in for loop - not working

HI Folks - I'm very frustrated - I'm trying to execute a verys imple for loop and rename the files if they exist. here is my loop : ydate=`TZ=aaa24 date +%m%d` CR_YR=$(date "+%Y") echo $ydate echo ${CR_YR} cd... (6 Replies)
Discussion started by: SIMMS7400
6 Replies

10. Shell Programming and Scripting

Why is my cut command not working ?

OS : RHEL 6.8 Shell : bash I want to remove all lines like below from the history output as it has password. $ history | grep sqlplus 239 sqlplus jn_usr/dxc825#@10.5.12.106/OCSGPD 256 sqlplus osb_soa/KD1egM09@10.5.12.196/BSOAPRD 279 sqlplus jn_usr/dxc825#@10.80.16.219/OCSGPD... (5 Replies)
Discussion started by: John K
5 Replies
Spreadsheet::WriteExcel::Chart::Pie(3pm)		User Contributed Perl Documentation		  Spreadsheet::WriteExcel::Chart::Pie(3pm)

NAME
Pie - A writer class for Excel Pie charts. SYNOPSIS
To create a simple Excel file with a Pie chart using Spreadsheet::WriteExcel: #!/usr/bin/perl -w use strict; use Spreadsheet::WriteExcel; my $workbook = Spreadsheet::WriteExcel->new( 'chart.xls' ); my $worksheet = $workbook->add_worksheet(); my $chart = $workbook->add_chart( type => 'pie' ); # Configure the chart. $chart->add_series( categories => '=Sheet1!$A$2:$A$7', values => '=Sheet1!$B$2:$B$7', ); # Add the worksheet data the chart refers to. my $data = [ [ 'Category', 2, 3, 4, 5, 6, 7 ], [ 'Value', 1, 4, 5, 2, 1, 5 ], ]; $worksheet->write( 'A1', $data ); __END__ DESCRIPTION
This module implements Pie charts for Spreadsheet::WriteExcel. The chart object is created via the Workbook "add_chart()" method: my $chart = $workbook->add_chart( type => 'pie' ); Once the object is created it can be configured via the following methods that are common to all chart classes: $chart->add_series(); $chart->set_title(); These methods are explained in detail in Spreadsheet::WriteExcel::Chart. Class specific methods or settings, if any, are explained below. Pie Chart Methods There aren't currently any pie chart specific methods. See the TODO section of Spreadsheet::WriteExcel::Chart. A Pie chart doesn't have an X or Y axis so the following common chart methods are ignored. $chart->set_x_axis(); $chart->set_y_axis(); EXAMPLE
Here is a complete example that demonstrates most of the available features when creating a chart. #!/usr/bin/perl -w use strict; use Spreadsheet::WriteExcel; my $workbook = Spreadsheet::WriteExcel->new( 'chart_pie.xls' ); my $worksheet = $workbook->add_worksheet(); my $bold = $workbook->add_format( bold => 1 ); # Add the worksheet data that the charts will refer to. my $headings = [ 'Category', 'Values' ]; my $data = [ [ 'Apple', 'Cherry', 'Pecan' ], [ 60, 30, 10 ], ]; $worksheet->write( 'A1', $headings, $bold ); $worksheet->write( 'A2', $data ); # Create a new chart object. In this case an embedded chart. my $chart = $workbook->add_chart( type => 'pie', embedded => 1 ); # Configure the series. $chart->add_series( name => 'Pie sales data', categories => '=Sheet1!$A$2:$A$4', values => '=Sheet1!$B$2:$B$4', ); # Add a title. $chart->set_title( name => 'Popular Pie Types' ); # Insert the chart into the worksheet (with an offset). $worksheet->insert_chart( 'C2', $chart, 25, 10 ); __END__ AUTHOR
John McNamara jmcnamara@cpan.org COPYRIGHT
Copyright MM-MMX, John McNamara. All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself. perl v5.10.1 2010-02-02 Spreadsheet::WriteExcel::Chart::Pie(3pm)
All times are GMT -4. The time now is 11:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy