Sponsored Content
Top Forums UNIX for Dummies Questions & Answers read a line from a csv file and convert a column to all caps Post 302154585 by orahi001 on Monday 31st of December 2007 11:33:04 AM
Old 12-31-2007
read a line from a csv file and convert a column to all caps

Hello experts,

I am trying to read a line from a csv file that contains '.doc' and print the second column in all caps.

e.g.

My csv file contains:
Test.doc|This is a Test|test1|tes,t2|test-3
Test2.pdf|This is a Second Test| test1|tes,t2|t-est3

while read line
do
echo "$line" | awk -F '|' '/.doc/ {print toupper($2)}'
done < $dataFile


output:
This is a Test


I've been trying to use the toupper function of awk but it does not convert to upper case.

Anyone know another way this can be done?


thanks
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

read file line by line print column wise

I have a .csv file which is seperated with (;) inputfile --------- ZZZZ;AAAA;BBB;CCCC;DDD;EEE; YYYY;BBBB;CCC;DDDD;EEE;FFF; ... ... reading file line by line till end of file. while reading each line output format should be . i need to print only specific columns let say 5th... (2 Replies)
Discussion started by: rocking77
2 Replies

2. Shell Programming and Scripting

Read csv file line by line

Folks , i want to read a csv file line by line till the end of file and filter the text in the line and append everything into a variable. csv file format is :- trousers:shirts,price,50 jeans:tshirts,rate,60 pants:blazer,costprice,40 etc i want to read the first line and get... (6 Replies)
Discussion started by: venu
6 Replies

3. Shell Programming and Scripting

Remove line feed from csv file column

Hi All, My requirement is to remove line (3 Replies)
Discussion started by: r_t_1601
3 Replies

4. Shell Programming and Scripting

Remove line feed from csv file column

Hi All, i have a csv file . In the 7th column i have data that has line feed in it. Requirement is to remove the line feed from the 7th column whenever it appears There are 11 columns in the file C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11 The value in C7 contains line feed ( Alt + Enter ),... (2 Replies)
Discussion started by: r_t_1601
2 Replies

5. UNIX for Dummies Questions & Answers

skip first line when doing a read of csv file

Folks, how do i skip the first line in a csv, while doing the read of a csv file in to a variable line by line. eg : do echo $line done < $rpt where rpt is path to csv file The initial 1st line is a garbage that i want to avoid, and start reading from 2nd line ... (2 Replies)
Discussion started by: venu
2 Replies

6. Shell Programming and Scripting

convert huge .xml file in .csv with specific column.

I have huge xml file in server and i want to convert it to .csv with specific column ... i have search in blog but i didn't get any usefully command. Thanks in advance (1 Reply)
Discussion started by: pareshkp
1 Replies

7. Shell Programming and Scripting

awk read column csv and search in other csv

hi, someone to know how can i read a specific column of csv file and search the value in other csv columns if exist the value in the second csv copy entire row with all field in a new csv file. i suppose that its possible using awk but i m not expertise thanks in advance (8 Replies)
Discussion started by: giankan
8 Replies

8. Shell Programming and Scripting

Convert a two-column list into a csv

Hi experts, I have a very large (1.5M lines), sorted but unstructured list that looks like this: process_nameA valueA process_nameA valueA ... process_nameB valueB process_nameB valueB ... process_nameN valueN I'd like to turn this into a csv. The values are all... (4 Replies)
Discussion started by: abercrom
4 Replies

9. Shell Programming and Scripting

Column with New Line in CSV file

Hello, Got a CSV file which contains 21 columns Need to convert the file to Pipe delimiter and Few columns text data contains new line Example 1,2,3,"ABC" 8" ABC,5,6,7 1,2,3,"ABC" 8" ABC,5,6,7 ( New Line) 1,2,3,""ABC" 8" ABC", 5,6,7 1,2,3,"ABC" ,5,6,7(New line) Expected... (8 Replies)
Discussion started by: krux_rap
8 Replies

10. Shell Programming and Scripting

Read csv file, convert the data and make one text file in UNIX shell scripting

I have input data looks like this which is a part of a csv file 7,1265,76548,"0102:04" 8,1266,76545,"0112:04" I need to make the output data should look like this and the output data will be part of text file: 7|1265000 |7654899 |A| 8|12660000 |76545999 |B| The logic behind the... (6 Replies)
Discussion started by: RJG
6 Replies
Test::Unit::Runner::Terminal(3pm)			User Contributed Perl Documentation			 Test::Unit::Runner::Terminal(3pm)

NAME
Test::Unit::Runner::Terminal - unit testing framework helper class SYNOPSIS
use Test::Unit::Runner::Terminal; my $testrunner = Test::Unit::Runner::Terminal->new(); $testrunner->start($my_test_class); DESCRIPTION
This class is a test runner for the command line style use of the testing framework. It is similar to its parent class, Test::Unit::TestRunner, but it uses terminal escape sequences to continually update a more informative status report as the runner progresses through the tests than just a string of dots, E's and F's. The status report indicates the number of tests run, the number of failures and errors encountered, which test is currently being run, and where it lives in the suite hierarchy. The class needs one argument, which is the name of the class encapsulating the tests to be run. OPTIONS
-wait wait for user confirmation between tests -v version info AUTHOR
Copyright (c) 2000-2002, 2005 the PerlUnit Development Team (see Test::Unit or the AUTHORS file included in this distribution). All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
o Test::Unit::TestCase o Test::Unit::Listener o Test::Unit::TestSuite o Test::Unit::Result o Test::Unit::TkTestRunner o For further examples, take a look at the framework self test collection (t::tlib::AllTests). perl v5.8.8 2006-09-13 Test::Unit::Runner::Terminal(3pm)
All times are GMT -4. The time now is 09:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy