10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hi Folks :)
I have a .txt file with thousands of words. I'm trying to sort the lines in order based on number of words per line.
Example
from:
word
word word word
word word
word word word word
word
word word word
word word
to desired output:
word (2 Replies)
Discussion started by: martinsmith
2 Replies
2. UNIX for Dummies Questions & Answers
URGENT HELP IS NEEDED!!
I am looking to move matching lines (01 - 07) from File1 and 77 tab the matching string from File2, to File3.txt. I am almost done but
- Currently, script is not printing lines to File3.txt in order.
- Also the matching lines are not moving out of File1.txt
... (1 Reply)
Discussion started by: High-T
1 Replies
3. Shell Programming and Scripting
I want to sort a file with a list of words, in order of most occuring words to least occurring words as well as alphabetically.
ex:
file1:
cat 3
cat 7
cat 1
dog 3
dog 5
dog 9
dog 1
ape 4
ape 2
I want the outcome to be:
file1.sorted:
dog 1 (12 Replies)
Discussion started by: castrojc
12 Replies
4. UNIX for Dummies Questions & Answers
Dear all,
Greetings.
I would like to ask for your help to extract lines with specific words in addition 2 lines before and after these lines by using awk or sed.
For example, the input file is:
1 ak1 abc1.0
1 ak2 abc1.0
1 ak3 abc1.0
1 ak4 abc1.0
1 ak5 abc1.1
1 ak6 abc1.1
1 ak7... (7 Replies)
Discussion started by: Amanda Low
7 Replies
5. UNIX for Dummies Questions & Answers
hello guys
i need a command that take the words from multiple files and put them in another file this way: one word needs to appear only once in the destination file with small letters no matter how it appears in source files , the words from destination file needs to be alphabetical ordered and... (10 Replies)
Discussion started by: G30
10 Replies
6. UNIX for Dummies Questions & Answers
Hi. I have a file containing words and numbers associated with them as follows -
c 2
b 5
c 5
b 6
a 10
b 16
c 18
a 19
b 21
c 27
a 28
b 33
a 76
a 115
c 199
c 251
a 567
a 1909 (4 Replies)
Discussion started by: maq
4 Replies
7. Shell Programming and Scripting
I hava a file with following data:
number|CREDIT_ID|NULL
date|SYS_CREATION_DATE|NULL
varchar2|GGS_COMMIT_CHAR|NULL
varchar2|GGS_OP_TYPE|NULL
number|GGS_SCN|NULL|
number|GGS_LOG_SEQ|NULL
number|GGS_LOG_POS|NULL
number|GGS_ORACREC_SCN|NULL
varchar2|BATCH_ID|NULL
char|GGS_IMAGE_TYPE|NULL
... (6 Replies)
Discussion started by: kolesunil
6 Replies
8. Shell Programming and Scripting
Please help in the following problem:
Input is:
Pritam
123
456
Patil
myname
youname
Pritam
myproject
thisproject
iclic
Patil
remaining text
some more text
I need the command which will display the no of lines between two words in the whole file.
e.g. Display all the no of lines... (5 Replies)
Discussion started by: zsudarshan
5 Replies
9. Shell Programming and Scripting
Hi
Im looking for a way, hopefully a one-liner to sort words in a line
e.g
"these are the words in a line"
to
"a are in line the these words"
Thanks! (15 Replies)
Discussion started by: rebelbuttmunch
15 Replies
10. Shell Programming and Scripting
How can I delete lines that contain 3 or more words?
I have a file, old.txt, that has multi-word phrases in it and I want to remove the lines with 3 words or more and send the output to new.txt.
I've tried the following using sed but it doesn't seem to work:
sed '/(\b\w+\b){3,}/d' old.txt >... (5 Replies)
Discussion started by: revax
5 Replies