Hi All, There is a multiple directories which had bunch of files (.txt), where I would like to read the (.txt) file n append some lines on each file using shell script. Could you pls guide me how to do this n provide the sample script. Thanks in advance. Cheers Jowsaki
Joined: Jan 20, 2004
What platform r u working on? Tried using VBScript to append to a .txt file? I have a VBScript that reads a .txt file in to an array to perform some calculations. I can modify it append to a .txt file. Let me know if you need it.
author and iconoclast
Originally posted by Pranav Butala: What platform r u working on? Tried using VBScript to append to a .txt file?
As this is the Linux/UNIX forum, the poster is lucky enough not to have VBScript available. Sham: This puts a line of text into a file, destroying any previous contents: echo "Here is a line of text" > afile.txt This, on the other hand, appends to an existing file: echo "Here is another line of text" >> afile.txt
Anyway, that's a start...it's basic stuff but bash scripting took me a while to get the hang of (mostly because I learned programming on languages with passably decent syntax..."for i in `seq 1 10`" is barbaric eh?...ok maybe that's just an excuse ), so it might save you some time... Cheers, --Tim [ April 13, 2004: Message edited by: Tim West ]