Hi all,
Not sure this should have gone in this area or the scripting one, but I've decided to put it in here as to not clog up the scripting thread with what might be a basic question.
Is it possible to create a custom column which displays the 1st line of a .txt file? I know the "floating" or "quick" preview options exist, but they require me to flick through each file to get a preview. I have several hundered .txt files which I want to quickly be able to mentally process by being able to see their 1st sentence. Failing this, is it possible to bulk rename .txt files to the 1st line of their containing content?
Apologies if this is somewhat of a stupid question, but I've searched on both this forum and on google but can't seem to find anything on this.
Thank you
Previewing 1st line of txt file as a custom column?
Re: Previewing 1st line of txt file as a custom column?
Code: Select all
return gettoken(readfile(<cc_item>), 1, <crlf>);
One of my scripts helped you out? Please donate via Paypal
Re: Previewing 1st line of txt file as a custom column?
Thanks a lot highend, I just tested it and it works great! Really appreciate the help, especially as you didn't need to go to the lengths of providing the actual code for me but still did! Time for me to go learn what each section of this code does by looking it up in the help manual
Re: Previewing 1st line of txt file as a custom column?
Thank you, very useful...
How about previewing first three lines of txt file?
How about previewing first three lines of txt file?
Re: Previewing 1st line of txt file as a custom column?
return gettoken(readfile(<cc_item>), 3, <crlf>, , 1);
?One of my scripts helped you out? Please donate via Paypal
Re: Previewing 1st line of txt file as a custom column?
It works, thank you very much.
My Custom Column:
return gettoken(readfile(<cc_item>), 2, <crlf>);
For my html file, custom column like this:
<html lang="tr-TR" dir="ltr"> <head> <meta charset="utf-8"> <title>XYplorer: File Manager for Windows</title> <!--ipt>
I want to see only title ("XYplorer: File Manager for Windows") in my custom column.
Is it possible?
Sorry for my bad English.
Re: Previewing 1st line of txt file as a custom column?
Use a regex to capture that part or just remove all other html tags and trim the result?
One of my scripts helped you out? Please donate via Paypal
Re: Previewing 1st line of txt file as a custom column?
Code: Select all
return regexreplace(regexmatches(gettoken(readfile(<cc_item>), 2, <crlf>), "<title>.*?</title>"), "<.+?>");
One of my scripts helped you out? Please donate via Paypal