10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hi all,
trying this using shell/bash with sed/awk/grep
I have two files, one containing one column, the other containing multiple columns (comma delimited).
file1.txt
abc12345
def12345
ghi54321
...
file2.txt
abc1,text1,texta
abc,text2,textb
def123,text3,textc
gh,text4,textd... (6 Replies)
Discussion started by: shogun1970
6 Replies
2. Shell Programming and Scripting
Hello,
I am looking for a specific situation in a text file. The conditions are,
> <CompoundName>
InChI=1S/C5H12NO2/c1-5(2)4-8-6(3)7/h5H,4H2,1-3H3/q+1
I am looking for cases where the line "> <CompoundName>" is followed by a line that contains the string "InChI=" without regard to... (5 Replies)
Discussion started by: LMHmedchem
5 Replies
3. Shell Programming and Scripting
Hi
I have a text file like below. THe content of the text will vary.
Entire text file have four consecutive lines followed with blank line.
I want to delete the occurrence of the two consicutive lines in the text file. I don't have pattern to match and delete. Just i need to delete all... (5 Replies)
Discussion started by: RJSKR28
5 Replies
4. Shell Programming and Scripting
I have a file lake this
cat ex1.txt
</DISCOUNTS>
<B2B_SPECIFICATION elem="0">
<B2B_SPECIFICATION elem="0">
<DESCR>Netti 2 </DESCR>
<NUMBER>D02021507505</NUMBER>
</B2B_SPECIFICATION>
<B2B_SPECIFICATION elem="1">
<DESCR>Puhepaketti</DESCR>... (2 Replies)
Discussion started by: Dhoni
2 Replies
5. Programming
performing this code to read from file and print each character in separate line
works well with ASCII encoded text
void
preprocess_file (FILE *fp)
{
int cc;
for (;;)
{ cc = getc (fp);
if (cc == EOF)
break;
printf ("%c\n", cc);
}
}
int
main(int... (1 Reply)
Discussion started by: khaled79
1 Replies
6. Shell Programming and Scripting
Can any one help us in finding the the last word of each line from a text file and print it.
eg:
1st --> aaa bbbb cccc dddd eeee ffff ee
2nd --> aab ered er fdf ere ww ww f
the o/p should be a below.
ee
f (1 Reply)
Discussion started by: naveen_sangam
1 Replies
7. Shell Programming and Scripting
I have a text file in the following format
....
START
1,1
2,1
3,1
..
..
9,1
10,1
END
....
I want to change to the output to
....
START
1,1
2,1
3,1
.. (4 Replies)
Discussion started by: VNR
4 Replies
8. Shell Programming and Scripting
Hi,
Please let me know how to find text and print text and its previous line. Please don't get irritated few days back I asked text and next line. I am using HP-UX 11.11
Thanks for your help. (6 Replies)
Discussion started by: kamranjalal
6 Replies
9. Shell Programming and Scripting
Hi All,
I need to print the lines after 2nd line irrespective of the number of lines in file
if the file contents are like below
----------
root:!:0:0::/root:/usr/bin/ksh
daemon:!:1:1::/etc:
bin:!:2:2::/bin:
sys:!:3:3::/usr/sys:
adm:!:4:4::/var/adm:
uucp:!:5:5::/usr/lib/uucp:... (6 Replies)
Discussion started by: ram1729
6 Replies
10. Shell Programming and Scripting
i have this text file name test.txt which contain :
aaaaa bbb
iiiiiiiiiiiii ccf
ddaaa ddd
and i need a script that can print out the line numbers using a while loop..
so when the script is run..it will have this:
1
2
3
any ideas? :) thanks guys (4 Replies)
Discussion started by: forevercalz
4 Replies