10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I want to sort a file which contains alphanumeric string.
bash-3.00$ cat abc
mtng1so
mtng2so
mtng11so
mtng9so
mtng23so
mtng7so
hstg2so
hstg9so
hstg1so
hstg11so
hstg13so
bash-3.00$
Want output like this, using one liner.
hstg1so (1 Reply)
Discussion started by: Raza Ali
1 Replies
2. Shell Programming and Scripting
I have a lot of data that need to be sorted alphanumerically. I began using sort -du and it solved almost all my problems. However, when I encountered files with data like this it began to fail:
/vol/close_eng_ice_0888
/vol/open_eng_ice_0890
/vol/open_eng_ice_08923
/vol/open_eng_ice_0893... (6 Replies)
Discussion started by: newbie2010
6 Replies
3. Shell Programming and Scripting
Hello
I have a file as below
chr1 start ref alt code1 code2
chr1 18884 C CAAAA 2 0
chr1 135419 TATACA T 2 0
chr1 332045 T TTG 0 2
chr1 453838 T TAC 2 0
chr1 567652 T TG 1 0
chr1 602541 ... (2 Replies)
Discussion started by: plumb_r
2 Replies
4. Shell Programming and Scripting
Hello,
How to sort each row in a document with numerical values and with more than one row. Example
Input data (file1.txt):
4 6 8 1 7
2 12 9 6 10
6 1 14 5 7
and I want the the output to look like this(file2.txt):
1 4 6 7 8
2 6 9 10 12
1 5 6 7 14
I've tried
sort -n file1.txt >... (12 Replies)
Discussion started by: joseamck
12 Replies
5. UNIX for Dummies Questions & Answers
I have a text file that has three columns. But at the end of the text file, there are trailing lines that have missing second and third columns:
4 0.04972604 KLHL28
4 0.0497332 CSTB
4 0.04979822 AIF1
4 0.04983331 DECR2
4 0.04990344 KATNB1
4
4
4
4
How can I remove the trailing... (3 Replies)
Discussion started by: evelibertine
3 Replies
6. Shell Programming and Scripting
Hi everyone,
I have file1 and file2 comma separated both.
file1 is:
Header1,Header2,Header3,Header4,Header5,Header6,Header7,Header8,Header9,Header10
Code7,,,,,,,,,
Code5,,,,,,,,,
Code3,,,,,,,,,
Code9,,,,,,,,,
Code2,,,,,,,,,file2... (17 Replies)
Discussion started by: cgkmal
17 Replies
7. Shell Programming and Scripting
Hi there,
I want to compare 2nd column which are alphanumeric values from each of the 2 files i.e.,lspv_pre.out and lspv_post.out , if found echo some message.
lspv_pre.out
hdisk0 00c39eaa451144dd rootvg active
hdisk1 00c39eaa45223322 ... (3 Replies)
Discussion started by: mbak
3 Replies
8. UNIX for Dummies Questions & Answers
Hello,
I have a text file that looks like this and I need a bash script to:
12:48:32 PM 002* OUT 000418
01:10:34 PM 002* ONL 000418
01:49:17 PM 001* OUT 000364
01:52:09 PM 001* ONL 000364
...
The fields are: 12-hour format time, some number, state (online, offline) and another... (2 Replies)
Discussion started by: Ravendark
2 Replies
9. Shell Programming and Scripting
I have a file I'm trying to sort such as
fred1
fred2
fred10
fred11
...
when I sort I get
fred1
fred10
fred11
fred2
...
using sort can any give me the syntax to sort this is dict order
e.g., (4 Replies)
Discussion started by: gefa
4 Replies
10. UNIX for Dummies Questions & Answers
Hello, I am new in UNIX
I am looking for a instrction to sort a file by columns 6,25 and 41
this is what I tried but not getting the correct result:
sort -t= -k1.6,1.25,1.41 to_sort.txt > sorted.txt
I used -t= just to get the whole line as one field.
INVS80993596SUM994338602XX... (1 Reply)
Discussion started by: murbina
1 Replies