9 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
So, I have three problems that cover this subject.
First one asks me to find the number of fields in the file that contain the substring "he". I found the number of fields, but the problem I have is that they are displaying by each record. I want to add all of the records' fields together.
With... (2 Replies)
Discussion started by: mc10
2 Replies
2. UNIX for Beginners Questions & Answers
hi,
would you help me?
i have file total.csv
"name","id","gender"
"a,"e23","f"
"b,"34d","g"
"c","45f","f"
"d","45s","f"
and file count.csv
3
i want to add file count to file total every row
name,id,gender,total_match
"a,"e23","f","3"
"b,"34d","g","3"
"c","45f","f","3"
... (4 Replies)
Discussion started by: kivale
4 Replies
3. Shell Programming and Scripting
In the tab-delimited input below I am trying to use awk to -10 from $2 and +10 to $3. Something like
awk -F'\t' -v OFS='\t' -v s=10 '{split($4,a,":"); print $1,$2-s,$3+s,a,$5,$6} | awk {split(a,b,"-"); print $1,$2-s,$3+s,b-s,b+s,$5,$6}' input
should do that. I also need to -10 from $4... (2 Replies)
Discussion started by: cmccabe
2 Replies
4. Shell Programming and Scripting
I have tab delimited input that prints out in the format below:
I am trying to add field headers to $5 and $6. Not sure if sed is the best tool but my attempt is below. Thank you :).
$5 = REF
$6 = ALT
file
ID CHR START STOP
123 1 100 200 A ... (6 Replies)
Discussion started by: cmccabe
6 Replies
5. Shell Programming and Scripting
Hi everybody (first time posting here)
I have a file1 that looks like >
1,101,0.1,0.1
1,26,0.1,0.1
1,3,0.1,0.1
1,97,0.5,0.5
1,98,8.1,0.218919
1,99,6.2,0.248
2,101,0.1,0.1
2,24,3.1,0.147619
2,25,23.5,0.559524
2,26,34,0.723404with 762 lines..
I have another 'similar' file2 >
... (10 Replies)
Discussion started by: murpholinox
10 Replies
6. Shell Programming and Scripting
Hi,
I want to add two fields with values '1000' and 'XYZ-1234' at the end of every line in a comma delimited file.
Should I use any command in a loop to add the fields or using any single command Shall I acheive it?
Kindly help me in code.
Thanks,
Poova. (6 Replies)
Discussion started by: poova
6 Replies
7. Shell Programming and Scripting
I have a large flat file with variable length fields that are pipe delimited. The file has no new line or CR/LF characters to indicate a new record. I need to parse the file and after some number of fields, I need to insert a CR/LF to start the next record.
Input file ... (2 Replies)
Discussion started by: clintrpeterson
2 Replies
8. Shell Programming and Scripting
Hi,
I have a huge text file. It looks like
abcde bangalo country 12345 lastfield
i want to get first 3 characters from field1 and first 3 characters from field 2 and insert the result as a new field. example the result should be:
abcde bangalo abcban country 12345 lastfield
Please... (4 Replies)
Discussion started by: ajithshankar@ho
4 Replies
9. Shell Programming and Scripting
Hi all!
I have two files containing one field each.
The fields consist of numbers separated in records e.g.
file1.dat
1657
2345
5678
5676
7978
7856
5686
5676
8990
.
.
. (2 Replies)
Discussion started by: bjorb
2 Replies