10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am trying to output a tab-delimited result that uses the data from a tab-delimited file to combine and subtract specific lines.
If $4 matches in each line then the first matching sequential $6 value is added to $2, unless the value is 1, then the original $2 is used (like in the case of line... (3 Replies)
Discussion started by: cmccabe
3 Replies
2. UNIX for Dummies Questions & Answers
I have a file that looks like this:
n1 1
n2 1
n3 1
n4 3
n4 3
n2 5
n2 5
n2 5
n2 5
n3 5
n3 5
n4 6
n7 6
that is a name followed be a descriptive number.
I want to make these numbers sequential starting from 0 but without changing the "neighbours" each name belongs to. So the above... (3 Replies)
Discussion started by: FelipeAd
3 Replies
3. UNIX for Dummies Questions & Answers
Hi experts, I have a tab-delimited file with one column containing values separated by a comma. I wish to duplicate the entire line for every value in that comma-delimited field.
For example:
$cat file
4444 4444 4444 4444
9990 2222,7777 6666 2222 ... (3 Replies)
Discussion started by: torchij
3 Replies
4. UNIX for Dummies Questions & Answers
Hi,
Trying to add a row of numbers. There are 24 number across. Would like to have column 25 sum each row.
10 3 45 49 0 24... Sum
3 200 3 9 1 3 ...... Sum
9 7 20 9 8 10 ...... Sum
Thank you. (5 Replies)
Discussion started by: jimmyf
5 Replies
5. Shell Programming and Scripting
Hi All,
I am looking for a simple way to write numbers to a file sequentially starting from 1 and ending on a specified upper limit. Example of the output file is below
Example
1
2
3
4
5
.
.
.
.
1000
please let me know the best way to do it. (10 Replies)
Discussion started by: Lucky Ali
10 Replies
6. Shell Programming and Scripting
Dear all,
i need your help on this. There is a text file, i need to count word frequency for each word with frequency >40 in each line of file and output it into another file with columns like this:
word1,word2,word3, ...wordn
0,0,1
1,2,0
3,2,0 etc -- each raw represents... (13 Replies)
Discussion started by: irrevocabile
13 Replies
7. Shell Programming and Scripting
Hi,
I would want to fetch all the numbers after a word the number of characters could very. how can I do that?
below is the example of the data and the expected output
sample data
03 xxxx occurs 1090 times.
04 aslkja occurs 10 times.
I would want to fetch 10 & 1090 separately. (13 Replies)
Discussion started by: ahmedwaseem2000
13 Replies
8. Shell Programming and Scripting
I have a file which will have rows like shown below,
ST*820*316054716
RMR*IV*11333331009*PO*40.31
REF*IV*22234441009*xsss471-2762
DTM*003*091016
ENT*000006
RMR*IV*2222234444*PO*239.91
REF*IV*1234445451009*LJhjlkhkj471-2762 </SPAN>
DTM*003*
091016
RMR*IV*2223344441009*PO*40.31... (18 Replies)
Discussion started by: Muthuraj K
18 Replies
9. Shell Programming and Scripting
Hello All!
As a beginner user i want to add up sequential values in a text file and want to print total sum as output.The Text file will have values like the following:
class1{root}>less SUM.txt
1140.00 1155.00 1183.00 ... # it continues #
i tried to write a... (1 Reply)
Discussion started by: EAGL€
1 Replies
10. Shell Programming and Scripting
Hope somebody is happy.
NR==1 {
num_columns=split( $0, menuend );
next;
}
{
split( $0, substrend );
for ( i=1; i<=NF; i++ ) {
minuend -= substrend;
}
}
END {
print "Result:";
for ( i=1; i<=num_columns; i++ ) {
printf(... (3 Replies)
Discussion started by: awkward
3 Replies