topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 8:36 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: DONE: Maintain lines in a txt according an aritmetic progression  (Read 8388 times)

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
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

c:/ejemplo.txt
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

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: DONE: Maintain lines in a txt according an aritmetic progression
« Reply #1 on: December 29, 2013, 09:50 AM »

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: DONE: Maintain lines in a txt according an aritmetic progression
« Reply #2 on: December 29, 2013, 12:24 PM »
Running to try
Best Regards
 :-*

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: DONE: Maintain lines in a txt according an aritmetic progression
« Reply #3 on: December 29, 2013, 12:43 PM »
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.
http://gnuwin32.sour...et/packages/gawk.htm

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:


MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: DONE: Maintain lines in a txt according an aritmetic progression
« Reply #4 on: December 29, 2013, 01:21 PM »
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.

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,286
    • View Profile
    • Donate to Member
Re: DONE: Maintain lines in a txt according an aritmetic progression
« Reply #5 on: December 29, 2013, 01:24 PM »
I'm almost done with this...stay tuned.

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,286
    • View Profile
    • Donate to Member
Re: DONE: Maintain lines in a txt according an aritmetic progression
« Reply #6 on: December 29, 2013, 02:02 PM »
Please give this a try:  http://skwire.dcmembers.com/apps/snacks/ControTextTool.zip

2013-12-29_135921.pngDONE: Maintain lines in a txt according an aritmetic progression

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: DONE: Maintain lines in a txt according an aritmetic progression
« Reply #7 on: December 29, 2013, 03:44 PM »
Running to try.
I was desperately looking for answers in the web and this is a beloved present.
 :-*

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: DONE: Maintain lines in a txt according an aritmetic progression
« Reply #8 on: December 29, 2013, 04:09 PM »
It's workingggggggggggggggggggggg, it's workingggggg !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Now the history :
Some time ago i ask in the forum to obtain the "titulars" from a search.
In the proof I have used the DuckDuckGo search engine.
In my pc and firefox browser the first line is the titular and the items found occupies three lines. So the next is the four. So I put

First Line 1 and every 3 lines after.....

As almost anyone in the forum i am obsessed with the software and how to do things. But obviously i have to found first what I want to do. Express the keys that I need. The language is complex. I use Goldmine - and have an special utility to do - for asking what I need. To remember what i did in the past.

Introduce all these patterns or search chains is boring. Very very boring, but neccesary if you have a lack of memory like me.

Ask the search engine for a method, a phrase, or anything give in the results many new keys useful to find an idea, a target.

And I want Contro Text Tool to do this.

After I use another special tool to introduce the registers in Goldmine

Obviously i take also the keys that usually appear in the google search engine to remember keys.

 :Thmbsup: :-*



Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: DONE: Maintain lines in a txt according an aritmetic progression
« Reply #9 on: December 29, 2013, 04:42 PM »
Thanks Skwire. Running and running every day. I am assigning a hotkey to invoke the program often and quickly

Best Regards
Happy New Year

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: DONE: Maintain lines in a txt according an aritmetic progression
« Reply #10 on: December 29, 2013, 04:53 PM »
Depending on the search engine the groups of keys appear in one way or another.
I am using also PSPad to assemble little details if all don't come in the copy-paste operation like I would.....


Wonderful
 ;D


skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,286
    • View Profile
    • Donate to Member
Re: DONE: Maintain lines in a txt according an aritmetic progression
« Reply #11 on: December 29, 2013, 06:38 PM »
Thanks Skwire. Running and running every day. I am assigning a hotkey to invoke the program often and quickly

You're welcome.  I'm glad it's working for you.  =]  I'll move this to the Finished section.

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: DONE: Maintain lines in a txt according an aritmetic progression
« Reply #12 on: December 29, 2013, 09:18 PM »
http://img101.imageshack.us/img101/7251/besotene2.gif
DONE: Maintain lines in a txt according an aritmetic progression
http://img101.imageshack.us/img101/7251/besotene2.gif
DONE: Maintain lines in a txt according an aritmetic progression
http://img101.imageshack.us/img101/7251/besotene2.gif
DONE: Maintain lines in a txt according an aritmetic progression
http://img101.imageshack.us/img101/7251/besotene2.gif
DONE: Maintain lines in a txt according an aritmetic progression