Jump to content

(Archived) how could i import a folder with huge number txt files, and make the txt file name as the note title?


emrehe

Recommended Posts

Hi,

i am trying to merge huge number text files from other note tools, i try to use the "import folder" function, but after import, the note title is some piece of the note contents, so my question is:

how could i import a folder with huge number txt files, and make the txt file name as the note title?

thanks,

Emre

Link to comment

When using import folders, txt files are imported as text, rather than attachments & IIRC, the title is set to the first line of the text file. AFAIK, there is no way to change how txt files are added when using an import folder. However, txt files can be added as attachments/icons, by individually dragging the file to EN & holding the shift button while dropping. In that case, the title is defaulted to the file name.

Link to comment

You don't mention which client you're using. But since you talked about import folders, I'm assuming you're using the Windows client. If you feel comfortable dinking around in the registry, you might try this:

Starting with rev 123659 if you hold down Shift key while dropping a file on EN4 or executing Attach File command the resulting attachment will not be expanded inline, i.e. pdf's will look like all other attachments and .txt/.enex files will be attached instead of being imported. For backward compatibility reasons this does not work for embedded .jpg/.png files by default, so if you want this to work for images, set HKCU\Software\Evernote\Evernote\StrictAttachments to 1.

/Peter

Link to comment

You don't mention which client you're using. But since you talked about import folders, I'm assuming you're using the Windows client. If you feel comfortable dinking around in the registry, you might try this:

Starting with rev 123659 if you hold down Shift key while dropping a file on EN4 or executing Attach File command the resulting attachment will not be expanded inline, i.e. pdf's will look like all other attachments and .txt/.enex files will be attached instead of being imported. For backward compatibility reasons this does not work for embedded .jpg/.png files by default, so if you want this to work for images, set HKCU\Software\Evernote\Evernote\StrictAttachments to 1.

/Peter

thanks, i am using windows clients, thank for your useful info.

Link to comment
  • Level 5*

On Mac, the process is really simple. You select the text files and drag them onto the app icon. Done :)

It might be worthwhile to borrow a friend's Mac, LOL. Seriously, though, it would be great if these kinds of nice little things could be standardized across clients, because any missing functionality can turn into a real bottleneck.

Link to comment
  • 1 year later...

How can I import a list of items so that each item is the title of a note.

The list can be in a simple text file or csv file.

For example, if I have a text file with all of the books I've read, how can I import that list so that each book is the title of a different note.

You would need to make a txt file from each line. You could write a simple script to do this. Then put the txt files into an import folder.

When using import folders, txt files are imported as text, rather than attachments & IIRC, the title is set to the first line of the text file. AFAIK, there is no way to change how txt files are added when using an import folder. However, txt files can be added as attachments/icons, by individually dragging the file to EN & holding the shift button while dropping. In that case, the title is defaulted to the file name.

Please search the board for more info on import folders, if necessary.

Link to comment

Hi,

i am trying to merge huge number text files from other note tools, i try to use the "import folder" function, but after import, the note title is some piece of the note contents, so my question is:

how could i import a folder with huge number txt files, and make the txt file name as the note title?

thanks,

Emre

I've read thru the replies to your question about batch importing.

 

I have a similar dilemma as I have been using a text editor to create my notes and keeping them in a folder for years and years dating back to 1987 beginning with MS Dos version 3 and continuing thru my years with MS Windows 7 and now Linux.

 

I have several computers and operating systems thru which I could connect to my notes from work and home.

Puppy Linux is my everyday go to home pc now with Chromium as my browser.  

 

 

I thought I'd give Evernote a dauntless try but trying to convert in a batch to Evernote is quite daunting to me now.

If I could get past this task painlessly I might see some value to me.

 

From what I've read below, forum members indicate that using a Windows machine to perform the drag and drop onto Evernote would do the trick.  Once in my Evernote container, then it wouldn't matter which computer I use from then on;  be it my various Linux operating systems or the few Windows machines I presently limitedly use to access my notes.

 

It's only a few days I've been trying out Evernote;  but I'll keep plugging away.....

Link to comment
  • Level 5*

Since this post is tagged as Windows, I've recommended use of the Evernote ENScript command. It's a command line program, suitable for use with the Windows command prompt (CMD.exe).
 
For example, if you have a text file in your current directory names MyNote.txt, you could add it to Evernote using the createNote command: 


ENScript createNote /s MyNote.txt /i MyNote.txt

 

This does exactly what was asked. Extend using the CMD 'for' command. Note that you may need to specify path directly to ENScript.exe if it's not in your PATH.

Link to comment
  • Level 5*

I just answered the same question elsewhere on the forum: http://discussion.evernote.com/topic/31369-how-could-i-import-a-folder-with-huge-number-txt-files-and-make-the-txt-file-name-as-the-note-title/?p=261619

The topics are now merged. 

 
ENScript will tell you its options if you just type it on the command line. To get the options for a particular command )(e.g., 'createNote'), type: ENScript createNote /?

Link to comment
  • Level 5*

Not sure how the VBScript would work, unless you're using it to call up ENScript to do the heavy lifting. Anyways, a straight ENScript and CMD.exe 'for' would definitely work.

The full set of ENScript options available:

  • /s file - file containing the plain text note contents. If omitted, note contents are read from standard input.
  • /n notebook - notebook to create the note in. If does not exist, lazy create. If omitted, use default notebook.
  • /b notebook - business notebook to create the note in. If does not exist, lazy create.
  • /i title - specifies note title. If omitted, note title will be generated automatically.
  • /t tag - specifies note tag. If tag does not exist, lazy create it. Use multiple /t options to specify multiple tags.
  • /a filename - specifies file attachment. Use multiple /a options or file masks to specify multiple file attachments.
  • /c dttm - note creation date/time. { "YYYY/MM/DD hh:mm:ss" | filetime }. If omitted, use current time.
  • /u username - user name if not the same as database file name.
  • /p password - user password to confirm Evernote service access.
  • /d database - database file name if user name is not specified.

In the requested case, filename and title are the same, so that makes things a bit easier. So we'd just want to use the /s and /i parameters with identical arguments:

  • The /s argument designates the file to be imported.
  • The /i argument specifies the new note's title

So this is the basic command for that (as noted before, you may need to explicitly path to the ENScript command; adjust accordingly):


ENScript createNote /s MyNote.txt /i MyNote.txt

 

One wrinkle, though: if the file to me imported does not have have a .txt extension, then the note will be imported as an attachment. We can get around that using standard command-line redirection, plus the fact that if a /s filename is not used, ENScript will read the note contents from standard input. So:
 

ENScript createNote <MyNote.ini /i MyNote.ini

 

To operate on a set of files in a directory, you can use the CMD.exe 'for' command, The syntax of the simple version:
 

for %variable in (set) DO command [command-parameters]

 

Where:

  • %variable specifies a single letter replaceable variable
  • set specifies a set of files, possibly wildcarded
  • command specifies the command to be carried out for each file
  • command parameters specifies the parameters to the command

These are all of the pieces that we need for a simple solution. To add all files in a directory, switch to that directory, and use something like:
 

for %a in (*.*) do ENScript createNote <%a /i %a

 

Interestingly, the 'for' command can also parse a text file (e.g. a CSV file) and pull out parameters for each line of the file, using the /F option. We can leave that for extra credit, but it aligns with the original request ('for' is a wondrously complicated command: http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/cmd.mspx?mfr=true). Additional notes: if you want to specify files in a different directory than the current directory, that should work, but you'll have a pathed filename as your title. I'm not sure how to remove the path using CMD.exe though (I use a different command shell that can handle stuff like that more easily).

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...