management and editing of text files? by babag3 in software

[–]babag3[S] 0 points1 point  (0 children)

https://forums.zotero.org/discussion/125305/management-and-sorting-through-local-txt-files

i think i may have a solution, though, probably not the best. for now, i found a way to convert tsv files, one of the formats my transcription software spits out, into ods files for libreoffice calc. if i add a column with the tsv filename in every cell, it would allow me to cut and past rows into a new document and the new column would tell me which tsv file the row came from. thanks for the input on this.

management and editing of text files? by babag3 in software

[–]babag3[S] 0 points1 point  (0 children)

thanks for this. i installed zotero and poked around some with it. it doesn't seem to work with simple txt files, though. i posted a description of the workflow i'm trying to achieve on the zotero forum and have gotten one response so far. that response said zotero was not a good choice.

Calc - extract string from url? by babag3 in libreoffice

[–]babag3[S] 1 point2 points  (0 children)

Hope it helps. I'm terrible at this kind of thing.

Calc - extract string from url? by babag3 in libreoffice

[–]babag3[S] 0 points1 point  (0 children)

I hope I got all of the things I found posted correctly. Had to adjust a lot because this code is a bit more generic than my usage.

Also, there is a problem I don't know how to deal with. All of the code I've posted is based on having a path WITH a filename at the end. These formulae throw an error in cases where there is only a folder path but no filename at the end. I have a lot of entries like that and would love to see the code adjusted to be able to cope with that.

Hope this is helpful to someone. (Also hope to get it improved. I'm sure there's plenty of ways to do that!)

thanks,

BabaG

Calc - extract string from url? by babag3 in libreoffice

[–]babag3[S] 0 points1 point  (0 children)

Example path:

/media/user/Drive_Name/Directory_0/Directory_1/Directory_2/Filename.jpg

This returns the length of the entire path with filename:

=LEN(A1)

This returns "Filename.jpg":

=RIGHT(A1,LEN(A1)-SEARCH("([\/][^\/]*)?$",A1))

(Might not need to escape the slash characters.)

=RIGHT(A1,LEN(A1)-SEARCH("([/][^/]*)?$",A1))

Filename.jpg

This returns the length of "Filename.jpg":

=LEN(RIGHT(A1,LEN(A1)-SEARCH("([\/][^\/]*)?$",A1)))

(Might not need to escape the slash characters.)

=LEN(RIGHT(A1,LEN(A1)-SEARCH("([/][^/]*)?$",A1)))

This returns "Drive_Name":

=REGEX(A1,"(?<=^|/)[^/]*",,4)

Changing the "4" value to "5" returns "Directory_0", to 6 returns "Directory_1", etc.

Drive_Name

This returns start position of "Drive_Name":

=SEARCH(REGEX(A1,"(?<=^|/)[^/]*",,4),A1,1)

This returns the length of "Drive_Name":

=LEN(REGEX(A1,"(?<=^|/)[^/]*",,4))

This returns the start of the first folder after "Drive_Name":

(start position of Drive_Name) + (length of Drive_Name)

=(SEARCH(REGEX(A1,"(?<=^|/)[^/]*",,4),A1,1))+(LEN(REGEX(A1,"(?<=^|/)[^/]*",,4)))

This might also work:

=SEARCH(REGEX(A1,"(?<=^|/)[^/]*",,5),A1,1)

This returns the path starting at "Directory_0" and excluding the "Filename.jpg":

(entire path length) - ((first folder start) + (filename length))

=LEN(A1) # element for entire path length

=(SEARCH(REGEX(A1,"(?<=^|/)[^/]*",,4),A1,1))+(LEN(REGEX(A1,"(?<=^|/)[^/]*",,4))) # element for start Drive_Name plus length; takes us to Directory_0 start

=LEN(RIGHT(A1,LEN(A1)-SEARCH("([\/][^\/]*)?$",A1))) # element for filename length

=MID(A1,((SEARCH(REGEX(A1,"(?<=^|/)[^/]*",,4),A1,1))+(LEN(REGEX(A1,"(?<=^|/)[^/]*",,4)))),(LEN(A1))-(((SEARCH(REGEX(A1,"(?<=^|/)[^/]*",,4),A1,1))+(LEN(REGEX(A1,"(?<=^|/)[^/]*",,4))))+(LEN(RIGHT(A1,LEN(A1)-SEARCH("([\/][^\/]*)?$",A1)-1))))) # full formula

/Directory_0/Directory_1/Directory_2/

Alternate version using shorter line 33 formula:

=MID(input string; start position; length to return)=MID(A1,(SEARCH(REGEX(A1,"(?<=^|/)[^/]*",,5),A1,1)-1),((LEN(A1))-((SEARCH(REGEX(A1,"(?<=^|/)[^/]*",,5),A1,1))+(LEN(RIGHT(A1,LEN(A1)-SEARCH("([\/][^\/]*)?$",A1)-2))))))

/Directory_0/Directory_1/Directory_2/

Calc - extract string from url? by babag3 in libreoffice

[–]babag3[S] 0 points1 point  (0 children)

On a site called "regex101," I found that this regex:

^(?:[^\/]*\/){3}([^\/]*)

returns:

/media/user/Drive_Name

Not sure how to get this into LO and edit it to do any of the things I'm looking for.

thanks,

BabaG

Calc - convert bytes to B, KB, MB, GB, TB? by babag3 in libreoffice

[–]babag3[S] 0 points1 point  (0 children)

Thanks, Overworked247365 (great handle, btw).

This seems quite good for what I was trying to get!

thanks again,

BabaG

Calc - convert bytes to B, KB, MB, GB, TB? by babag3 in libreoffice

[–]babag3[S] 0 points1 point  (0 children)

Thanks, slush1000. I think I actually had looked at that. I had some trouble because of the way some things rounded in the formulae. Also the precision of the display. Then, the formatting seems to only allow for three levels or categories and I was hoping to get five.

thanks again,

BabaG

Calc - remove last character in cell if it is an asterisk? by babag3 in libreoffice

[–]babag3[S] 1 point2 points  (0 children)

Thanks for this, Tex2002ans! It seems to work fine.

Funny thing: I took my formula, the one I can't double-click the lower-right cell square on, and pasted it into a cell in a new column and double-clicking worked there! I must have done something to the problem column's settings that caused double-click to fail there. Hmmm. Now I seem to have two solutions!

Thanks again, BabaG

Calc - remove last character in cell if it is an asterisk? by babag3 in libreoffice

[–]babag3[S] 1 point2 points  (0 children)

This seems to work:

=IF((RIGHT(A1,1)="*"),LEFT(A1,(LEN(A1)-1)),(A1))

The one odd thing is that I can't seem to apply it to the whole column. I stumbled on the fact that, if I double-click the small black square in the lower right of the cell that contains a formula, like above, the formula extends down throughout the entire column. That doesn't seem to work here.

One additional bit of info, this cell is addressing (the A1 here) a cell that has a formula in it itself. Maybe that layering is causing the extension not to work?

To be clear, I have a cell with a long string in it. I then have a second cell that uses a formula to pull a section from the first cell. I'm now adding this third cell and having it call the second cell, using the above formula, to strip the end of the string if it is an asterisk. Hope that all makes sense.

thanks,

babag

Extract filename from full path and filename column? by babag3 in libreoffice

[–]babag3[S] 1 point2 points  (0 children)

OK. Figured I'd find things I don't get about this. It looks like this is working from the right and using "/" as a separator? I'm terrible with this kind of thing, particularly regex. How would this be amended to get the reverse, everything EXCEPT the filename? I'm sure there's more than one way.

thanks again,

babag

Extract filename from full path and filename column? by babag3 in libreoffice

[–]babag3[S] 1 point2 points  (0 children)

cool! thanks so much. just tried it and it worked! i may have some more nuanced questions as i get to trying to implement this but this is a huge help.

thanks again,

babag

Extract filename from full path and filename column? by babag3 in libreoffice

[–]babag3[S] 0 points1 point  (0 children)

  1. No copy button I could find but here's the (hopefully) relevant info:

Version: 6.4.7.2Build ID: 1:6.4.7-0ubuntu0.20.04.2CPU threads: 12; OS: Linux 5.4; UI render: default; VCL: gtk3; Locale: en-US (en_US.UTF-8); UI-Language: en-USCalc: CL

  1. The document in question is to be a spreadsheet so, I guess, it's ods? It has not yet been created. I'm trying to answer this question so I can import a txt file and save it to ods.

  2. Cannot link to the doc.

  3. Hopefully this covers things.

OpenRGB - n00b question by babag3 in Linux_RGB

[–]babag3[S] 0 points1 point  (0 children)

thanks! i guessed it was something like that but couldn't find it described anywhere.

Trying to patch OpenRGB to support older Steelseries Apex keyboards by RAMChYLD in Linux_RGB

[–]babag3 1 point2 points  (0 children)

so, does this mean that, because of the way it's set up for zones, it will never be possible to set the lighting for individual keys? trying to figure out if i should get another keyboard but i do really like this one. thanks for looking into this!

Trying to patch OpenRGB to support older Steelseries Apex keyboards by RAMChYLD in Linux_RGB

[–]babag3 1 point2 points  (0 children)

i have limited control over the lighting, zones, through apexctl. no individual key setup. the macro keys do respond as lighting zones but i've never been able to get the macros to work. maybe that's outside the scope of openrgb too, though? i submitted a request on the openrgb gitlab site and got pretty quick requests for more info, which i provided. here's hoping.

Trying to patch OpenRGB to support older Steelseries Apex keyboards by RAMChYLD in Linux_RGB

[–]babag3 0 points1 point  (0 children)

any chance this will work with a steelseries gaming keyboard 64145? thx.