10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hi..
I need some help in converting the below horizontal lines to vertical lines format.
can anyone help me on this.
input file
Hour,1,2,3,4,5
90RT,106,111,111,112,111
output file
Hour,90RT
1,106
2,111
3,111
4,112
5,111 (3 Replies)
Discussion started by: Raghuram717
3 Replies
2. UNIX for Beginners Questions & Answers
Hi,
I want to duplicate lines of a csv file with header if a column has multiple values. The csv uses semicolon as separator while multiple values are separated with comma. Only the type3 column can have multiple values.
input:
type1;type2;type3
a1;b1;x,y
a2;b2;z
output:
a1;b1;x... (2 Replies)
Discussion started by: iz_82
2 Replies
3. Shell Programming and Scripting
have written a combined sed+awk to perform a lookup operation which works but looking to enhance it.
looking to match a record using any of the comma separated values + return selected fields from the record - including the field header. so:
cat foo
make,model,engine,trim,value... (6 Replies)
Discussion started by: jack.bauer
6 Replies
4. Shell Programming and Scripting
Hi Guys,
Would need your expert help with the following situation..
I have a comma seperated .csv file, with a header row and data as follows
H1,H2,H3,H4,H5..... (header row)
0,0,0,0,0,1,2.... (data rows follow)
0,0,0,0,0,0,1
.........
.........
i need a code... (10 Replies)
Discussion started by: dev.devil.1983
10 Replies
5. Shell Programming and Scripting
Hi,
I have the following test script I'm working with:
date +"%m-%d-%y">>test.log
grep eth0 /proc/net/dev | awk '{print ",",$2/1024/1024,",",$10/1024/1024}'>>test.log
The output looks like this:
02-25-12
, 19.3581 , 84.2826
02-25-12
, 19.3587 , 84.283
02-25-12
, 19.3587 ,... (4 Replies)
Discussion started by: nbsparks
4 Replies
6. Shell Programming and Scripting
Hi Fellows,
I have been struggling to fix an issue in csv records to compose sql statements and have been really losing sleep over it. Here is the problem:
I have csv files in the following pipe-delimited format:
Column1|Column2|Column3|Column4|NEWLINE
Address Type|some descriptive... (4 Replies)
Discussion started by: khayal
4 Replies
7. Shell Programming and Scripting
Hello,
Does anyone have a one-liner to remove lines of a csv file if the value in a specific column is zero? For example, I have this file,
12345,COM,5,0,N,29.95,Y
12345,MOM,1,0,N,29.95,Y
12345,COM,4,0,N,9.99,Y
12345,MOM,0,2,N,9.99,Y
12345,REN,0,1,N,9.99,Y
and I want to remove lines... (4 Replies)
Discussion started by: palex
4 Replies
8. Shell Programming and Scripting
Hello
So I understand when I do the following
used_ports=$(netstat -nat |cut -d : -f 2 |cut -d ' ' -f 1)
that the output will look like this
Active Proto 5298 22 631 55012 56093 39672 43196 56619 39677 36103
38453 41413 56137 37902 41410 41414 43195 38426 49253 38420 34273 ... (1 Reply)
Discussion started by: brsett
1 Replies
9. Shell Programming and Scripting
I have written an script which will excluded some records from .csv file and put it on another excluded file from primary file.This is working very fine.Now the problem is that I want to delete those excluded lines from Primary file but not able to delete it.
I have stored the line number in... (1 Reply)
Discussion started by: 009satya
1 Replies
10. Shell Programming and Scripting
I have a csv file looking like:
echo,w-cai,w-cai-ssl
echo,countrywide,countrywide-ssl
haystack,intranet3,intranet3-ssl
haystack,pnf,pnf-ssl
Basically, I want to process this file row by row assigning each word delimited by a comma to a variable.
ie. for the first row, $variable1=echo... (5 Replies)
Discussion started by: Sn33R
5 Replies