Python Forum
my thoughts on a vsplice command
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
my thoughts on a vsplice command
#1
i'm thinking of calling this command vsplice. its duty is to splice (maybe many) files together from selected vertical alignments and ranges. a list of arguments will specify a sequence of vertical stripes to be extracted and how to align them for output. one argument will generally expressing one stripe. so what i need to create is a syntax that can fit in one argument and allow expressing where the stripe comes from and goes to, with the option to allow leaving specifications empty to use defaults.

first, there is a file name, or not. if there is no file name, the previous file continues to be used for this stripe. the file name is detected by being something different than other things that come next, but will come up now. if the intended file name looks like a specification then it can be prefixed with a leading absolute path, a prefix of the current directory ("./"), be quoted, or prefixed with a comma that does not become part of the name string. next is a number that specifies where the stripe begins. if the start position is omitted and this is a new file, the stripe begins at the start of the new file. if the start position is omitted and this is a file that was used before, the stripe begins where the previous strip ended.

the position is in fixed character positions. but i also want to be able to specify a character (or maybe a string) to move forward to, to find where the stripe begins. the character that ends the number's digits is it unless it is a quote or one on + - = : that could begin the 2nd subspec in this argument. the numbers may have a prefix + = = that means relative forward, relative backward, or absolute. the number by itself is absolute by default but there will be a way to change it. the delimiter can always be put in quotes which allows a string delimiter. a : separates the 2nd subspec, or can be left out if not needed. numbers are in decimal unless they begin with "0x", "0y" (base 32), "0o", "0q" (base 4), "0t" (base 3), "0b", or "0d" (another way to specify decimal). the specification may be followed by * and a number for a simple stripe repeat.

i still need to think through how to specify where stripes go to. this should include ways to add delimiters and background characters like white space. speaking of white space, i need a way to specify a white space delimiter that works like no args for .split.

these are just my initial thoughts (brain farts) and subject to change (often in weird ways).
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Looking to hear the thoughts of Python developers vmdepyth 2 33,012 Dec-14-2016, 03:41 PM
Last Post: vmdepyth
  [split] Thoughts of re-imagining somethin in python nilamo 3 5,454 Oct-04-2016, 12:44 PM
Last Post: wavic

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020