10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I have a "|" delimited file that is exported from a database.
There is one column in the file which has description/comments entered by some application user. It has "Control-M" character and "New Line" character in between the text.
Hence, when i export the data, this record with the new... (4 Replies)
Discussion started by: tarun.trehan
4 Replies
2. UNIX for Dummies Questions & Answers
Hi,
I have a large text file with the following format:
>gi|347545744|gb|JN204951.1| Dismorphia spio voucher 5
ATCAAATTCCTTCCTCTCCTTAAA
>gi|17544664774|gb|WN204922.32| Rodapara nigens gene region
CCGGGCAAATTCCTTCCTCTCCTTAAA
>gi|555466400|gb|SG255122.8| Bombyx mandariana genbank 3... (1 Reply)
Discussion started by: euspilapteryx
1 Replies
3. Shell Programming and Scripting
Guys,
I know that the below command will cut the 13th field from test.txt file
awk -F"|" '{print $13}' test.txt
The answer would be,
CA
CN
Ohio
If we see the 3 rd one, it has more than 2 characters. So i wanted to check this in if condition and i want to get the output if the 13th... (4 Replies)
Discussion started by: AraR87
4 Replies
4. UNIX for Dummies Questions & Answers
When I use vi to see what's in the file I get this:
int add1(int x) {^M return x + 1;^M}
^Mint subtract1(int x) {^M return x - 1;^M}
^Mint double_it(int x) {^M return x * 2;^M}
^Mint halve_it(int x) {^Mreturn x / 2;^M}
^Mint main() {^M int myint;^M int result;^M ... (2 Replies)
Discussion started by: Nonito84
2 Replies
5. Shell Programming and Scripting
I have a file where the text might exceed 80 characters. I want to have the maximum text lengths to be 80, and cut text from a space.
I written an awk script below but does not seem to work very well
{
gsub("\t"," ")
$0 = line $0
while (length <= WIDTH) {
line = $0
... (3 Replies)
Discussion started by: kristinu
3 Replies
6. Shell Programming and Scripting
I have a file which looks like this. I only show first 11 lines of the file followed by some text that appears at the end of every file.
1. file:///path1/path2/path3/path4/251192.dat (score 3.849384, docid 142923)
2. file:///path1/path2/path3/path4/173859.dat (score 3.831033, docid 75365)
3.... (4 Replies)
Discussion started by: shoaibjameel123
4 Replies
7. UNIX for Dummies Questions & Answers
I have a text file that looks like this:
I want to delete the last character of first column in all rows so that my output looks like this:
Thanks a lot! (1 Reply)
Discussion started by: evelibertine
1 Replies
8. Shell Programming and Scripting
ok, so i have the following text to replace but it's not working. can someone please help me out:
:%s~awk '// {split($2,s,",");a=$1 FS s} /-/ {b=a} END{print b}'~tail -1~g
I want to replace the entire awk command with tail -1.
thanks (7 Replies)
Discussion started by: SkySmart
7 Replies
9. Shell Programming and Scripting
I have a requirement where i have to read from a .sh file a text lying bet characters like 'SELECT' & ';'...Please help me out in this. I am new to shell scripting. (2 Replies)
Discussion started by: goutam_igate
2 Replies
10. Shell Programming and Scripting
Using sed or awk, I need to display text between two words/characters. Below are two example inputs and the desired output. In a nutshell, I need the date-range value between the quotes (but only the first occurance of date-range as there can be more than one).
Example One Input:
xml-report... (1 Reply)
Discussion started by: cmichaelson
1 Replies