ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Finished Programs

SOLVED: Insert text string to front / end of each line in a text file

<< < (4/4)

JimboNWUK:
OK folks, as a result of flowowery's requests from up above, I have released a version 2.0 hot on the heels of version 1.2 that does exactly what he was asking: it lets you (a) begin the processing at a line of your choice (b) skip however many lines you like incrementally and (c) insert line numbers zero-padded to whatever length you want.

I had to move the embedded spaces stripping to the function list but the whole blank line exclusion is still on its own in "General".

I am expecting the next request to be "can we have a user-defined separator after the line number" (because it is what I thought of as I was implementing it!) but for now I will let it be (I do actually use this myself to process logfiles, errorlogs, audit trail files etc. -- which was what prompted me to write it -- so I want to give it some 'play testing' myself!)

The way I have structured the code makes it pretty easy to implement extra functions, so if you think of a good 'un please let me know either via this forum or click "Contact Jollybean Webmaster" on the page. BTW the screenshot, help file, and zip download are all up to date with rel. 2.0 AFAIK but if you find otherwise let me know ASAP.

Best regards to all,

Jim.

JimboNWUK:

Additional update: increased to release 2.1 to add a "Replace[]With:" setting to the ini file. I hit this problem not long after the last update so the fix has had to go in the quickest way I could think of. Because the statement parser relies upon the presence of square brackets to find the parameters within the statement this causes problems if one of your parameters is, or contains, a square bracket. This setting allows you to choose 2 other characters with which to replace them (and is set to the 'curly brackets' by default). You can then use the curly brackets (or your chosen replacement) wherever you originally intended to use the square brackets. This replacement will take place before any other operation on the text. If your text contains square brackets that do not form part of your parameters, and that you do not want changed, simply set the replacements to "[]".

Regards,

Jim.

Navigation

[0] Message Index

[*] Previous page

Go to full version