10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi Guys,
I am new to shell script.I need your help to write a shell script.
I have a csv file which has 13 columns separated by ,
I have written below script to fetch required 5 columns.
awk -F, '(NR==1){h3=$3;h4=$4;h8=$8;h9=$9;h13=$13;next}(NF>1) \
{print... (5 Replies)
Discussion started by: Vivekit82
5 Replies
2. Shell Programming and Scripting
hi,
I had a small question.I had a file from which i need to extract data.
I have written the below script to check if the file exists and if it exists extract requierd columns from the file.
IFILE=/home/home01/Report_1.csv
OFILE=/home/home01/name.csv.out1
if #Checks if file exists... (1 Reply)
Discussion started by: Vivekit82
1 Replies
3. Shell Programming and Scripting
Hi All,
I have a file with 3 millions records in which 3rd column is same throughout say its value is 0 throughout.for example:
Col1 Col2 Col3 Col4
A 1 0 5
B 2 0 6
C 3 0 7
D 4 0 9
I want my output as :
Col1 Col2 Col3 Col4
A 1 ... (4 Replies)
Discussion started by: Pinky456
4 Replies
4. Shell Programming and Scripting
Hello experts,
I have a requirement where I have to implement two checks on a csv file:
1. Check to see if the value in first column is duplicate, if any value is duplicate script should exit.
2. Check to verify if the value at second column is between "yes" or "no", if it is anything else... (4 Replies)
Discussion started by: avikaljain
4 Replies
5. Shell Programming and Scripting
Hi
I have the file called "file.txt" which contains the following output
$cat file.txt
sandy
<version>1</version>
karen
<version>2</version>
Rob
<version>3</version>
peter
<version>4</version>
i want to write a command which will add the value 1 to the digits and show the output... (2 Replies)
Discussion started by: sidh_arth85
2 Replies
6. Shell Programming and Scripting
My scripts excepts 4 files
ABCD_01
ABCD_02
ABCD_03
ABCD_04
I want to check for these files , and increment counter one by one .
at the end i would like to echo as 4 of 4 expected instances of file found .
I tried something like thsi
$counter =1
if
counter=counter+1
i need... (5 Replies)
Discussion started by: ultimatix
5 Replies
7. Shell Programming and Scripting
Hi All,
I have a file which is having 3 columns as (string string integer)
a b 1
x y 2
p k 5
y y 4
.....
.....
Question:
I want get the unique value of column 2 in a sorted way(on column 2) and the sum of the 3rd column of the corresponding rows. e.g the above file should return the... (6 Replies)
Discussion started by: amigarus
6 Replies
8. Shell Programming and Scripting
Hi,
I have a sample file like below:
213~!0~!Feb 16 2009 4:57:29:833PM~!0
212~!0~!Feb 7 2009 5:29:57:760PM~!0
211~!0~!Feb 4 2009 5:51:40:863PM~!0
209~!0~!Dec 17 2008 3:19:05:043PM~!0
206~!0~!Dec 4 2007 4:01:02:850PM~!0
"~!" is the field seperator.
I need to replace the... (5 Replies)
Discussion started by: h_banka
5 Replies
9. UNIX for Dummies Questions & Answers
Hi All,
I have a file with 10 columns and get the required data for nine columns properly except 8th. In 8th column i have both NULL and NON NULL values...i.e
certain records have values for all the columns including 8th column and certain records have 8th column as NULL.My requisite is,without... (20 Replies)
Discussion started by: ganesh_248
20 Replies
10. Shell Programming and Scripting
Hi All,
I have a table with 10 columns. Some columns(2nd,4th,5th,7th,8th and 10th) are Not Null columns. I'll get a tab-delimited file and want to check col by col and generate seperate error code for each col eg:102 if 2nd col value is NULL and 104 if 4th col value is NULL so on... I am a... (7 Replies)
Discussion started by: Mandab
7 Replies