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

DONE: Maintain lines in a txt according an aritmetic progression

(1/3) > >>

Maintain lines in a txt according an aritmetic progression

I would like a snack to :
1. Select a txt file
2. Introduce the number of the first line to maintain
3. Introduce the reason of an aritmetic progression .

By example

first line is 2
and the reason is 5

The script will be able of :

Maintain lines 2, 7, 12, 17, etc until the end of the file
Remove the rest of lines

Can you do it ?

Best Regards
Happy New Year

Seems rather trivial for awk

Running to try
Best Regards

grasp grasp grasp cough cough
Win32, i.e. MS-Windows 95 / 98 / ME / NT / 2000 / XP / 2003 / Vista with msvcrt.dll and msvcp60.dll. If msvcrt.dll or msvcp60.dll is not in your Windows/System folder, get them from Microsoft, or (msvcrt.dll only) by installing Internet Explorer 4.0 or higher.

Do you really expect me to develop a new language ?  :o

I am using windows 7. Seems not directly for windows 7 or need additional libraries.
Is this necessary ?
Don't you have a click click solution ?  :tellme:

I'm sure you could find a stand-alone nawk.exe someplace.  Also when you say "maintain" I'm not sure what you mean.  If you copy lines to another file do you keep the old file to preserve the line count?  Replace lines in the original file with new line char(s)(empty line?)  Or just take the data and run?  It's kind of vague other than that you want the lines depending on line number in the file.


[0] Message Index

[#] Next page

Go to full version