answersLogoWhite

0


Want this question answered?

Be notified when an answer is posted

Add your answer:

Earn +20 pts
Q: Write a program to number the lines in a file?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Write a C program to extract a given word from a file?

program to extract a given word from a file


Write java program to merge alternate lines from file1 and file2 into file1?

I suggest something like this:* Open file1 and file2 * Create a temporary output file, for writing * Read a line from file1, write it into the output file * Read a line from file2, write it into the output file * Repeat the previous two steps, while you are not at end-of-file in either of the two files * At this point, if you are NOT at end-of-file in file1, read the remaining lines of file1, and write them to the output (you can write a loop for this). * Similarly, if you are NOT at end-of-file in file2, read and write the remaining file. * Close file1, file2, and the output file. * Copy the temporary output file back to file1 * Erase the temporary output file


How do you write a shell script which counts the number of lines and words present in a given file?

#!/bin/sh wc -lw "$1"


What opening a file creates a file on a disk and allows the program to write data to it?

Opening a file...for writing!


How do I write a program to do the following... Write a VBA code to take the TippingBucketData.txt file and process it to generate an output file.?

Without knowing the contents of the TippingBucketData.txt file nor how to process it, it would be impossible to say how such a program would be written.


How can write a c program to store students record in a file?

Write a console based C++ program that reads student information from a text file, build an array of objects of type class StudentInfo,


Write a shell script that counts the no of lines and words in a file?

You don't need a script, just use the 'wc' command: # Lines wc -l <file> # Words wc -w <file>


Write a program to show deleting a file?

#!/bin/bash rm -rf *


Is it more efficient to store the data in a matrix then write it to the file at the end of the program or to write each element to the file as the program runs?

It shouldn't make significant difference, only if the matrix is huge -- in that case you shouldn't store it in memory.


Write a C program that takes a binary file as input and finds error check using different mechanisms?

write a c program that takes a binary file as input and finds error check using different mechanisms.


Write a C program to extract a word from a delimiter text file?

not yet found


Is created by a user for instance a report you write with a word processing program.?

data file