i'm trying to make a code to read in a file with for example 10 lines of text
and then enter a text at line 5
i also need it to round up the number e.g if theres 11 lines input the added text at line 6
so the script example is:
please enter a line of text:
hello there
please enter file name
filename.txt
line of text successfully added to the middle of the file filename.txt
so out come =
line1
line2
line3
hello there
line4
line5
thanks in advance for your help
unix: read line by line help
Moderator: General Moderators
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
If you're using PHP: http://us3.php.net/manual/en/features.commandline.php