Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to add a line after end of line ??

Status
Not open for further replies.

ok1397

Technical User
Feb 7, 2005
70
US
Hello everyone, i'm having trouble adding a line and insert certian text after end of line. When end of line reached start a new line and insert line of text. I have 2 text files, i compare the first 16 characters on both files, if they match insert text line from file2 to file1. I can't get it to work where it will insert on a new line. Here's part of file1 and file2

SKUABC {ON HAND=100} {QTY AVAIL=50} {WH1 AVG=20} ;(text line in File1 warehouse1)
SKUABC {ON HAND=25} {QTY AVAIL=10} {WH2 AVG=5} ;(text line in File1 warehouse2)

if first 16 characters on each file match search for end of line of File1 and insert new line with text line from File2. Thanks for your help.
 
You may have to have a third file as your output file. I don't think you can write/read a file simultaneously, and I'm almost positive that you can't just insert a line in the middle of an existing file.
 
Hi kodr, thank you for responding. i was able to insert the text line with matching 1st 16 characters onto File1, the first line inserts ok but the rest is all over the place (in the middle of existing file). And want to make sure i can insert all matching text line from File2 at once (in sequence). If worst comes to worst guess will have to creat a third file.
 
Thanks knob i will give it a try !!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top