10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I need to number the lines in my text file. I know how to do this with standard numbering (1,2,3,4, etc) but I need to count in multiples of 5, beginning 0,5,10,15...
example existing file:
abcd
efg
hijklm
nopqrs
desired output
0 abcd
5 efg
10 hijklm
15 ... (11 Replies)
Discussion started by: livbaddeley
11 Replies
2. 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
3. UNIX for Dummies Questions & Answers
Hi,
I am trying to extract lines from a text file given a text file containing line numbers to be extracted from the first file. How do I go about doing this? Thanks! (1 Reply)
Discussion started by: evelibertine
1 Replies
4. UNIX for Dummies Questions & Answers
##### (0 Replies)
Discussion started by: lucasvs
0 Replies
5. UNIX for Dummies Questions & Answers
the text file like below's
input:
aaaaaaaaafdsfsda
sdfsadfasdfasfds
sdfadsf
asdfadf
asdfa
adfsfsafas
sdfsfafads
asdfasdfsa
I want to print out consecutive two line
output:
aaaaaaaaafdsfsda (1 Reply)
Discussion started by: vincent_W
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
Hi,
I would like to know how to solve one of my problems using expert unix commands.
I have a file with occasional blank lines;
for example;
dertu
frthu
fghtu
frtty
frtgy
frgtui
frgtu
ghrye
frhutp
frjuf
I need to edit the file so that the file looks like this; (10 Replies)
Discussion started by: Lucky Ali
10 Replies
8. Shell Programming and Scripting
Hi all
How to add line numbers in text file..
ex
abcd
cdef
result
1. abcd
2. cdef
thx in advance (4 Replies)
Discussion started by: suryanarayana
4 Replies
9. 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
10. 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