Submitted by Paul_J_Miller on 2018/10/14 07:13
I have a number of text files on disk which I want to import into InfoQube.
 
I would like them to have the plain text content of the file imported into the document pane and the item title set to the file name (preferably without the file extension).
 
I have tried drag and drop but this creates a link to the file on disk which is not what I want.
 
The text import seems to think they should be .CSV files.  They are not, they are just plain text.
 
There are a lot of files so copying and pasting the contents of each file is not an option.
 
What is the simplest way to do this?
 

Comments

Hi Paul,
 
Plain text document type in the Doc pane in on my list of todo. Perhaps I'll work on it in v111
 
In the meantime, Drag-drop can do this for you and supports multiple files:
 
(Uncheck Show this dialog and it will create all items at once)
 
It does indeed create a link to the file, but it is then easy to convert to embedded storage:
  • Click the New HTML Document
  • Press 2 (Copy the content)
 
Pierre_Admin
IQ Designer
 

Paul_J_Miller

2018/10/15 11:39

In reply to by Pierre_Admin

[quote=Pierre_Admin]
It does indeed create a link to the file, but it is then easy to convert to embedded storage:
  • Click the New HTML Document
  • Press 2 (Copy the content)
 
Pierre_Admin
IQ Designer
 
[/quote]
 
And can this be done for many documets at once ?
 

Pierre_Admin

2018/10/15 11:42

In reply to by Paul_J_Miller

It would be nice, but no...
 
If you can wait, I can add a file importer
 
Pierre_Admin
IQ Designer
 

DragonGem

2018/10/15 14:15

In reply to by Pierre_Admin

Pierre,

Make sure you add an option for how to handle Carriage-Return / Line-Feeds (line breaks) within the Text files; i.e. replace with <br> or <p>. The process described above works for the default Formatting style, but changing to Normal style causes all of the lines to run together. 

Paul_J_Miller

2018/10/15 14:18

In reply to by Pierre_Admin

[quote=Pierre_Admin]
If you can wait, I can add a file importer
 
Pierre_Admin
IQ Designer
 
[/quote]
 
It would be useful to be able to import text files.
 
I would make the case that there is a lot of information out there in legacy ASCII text files.
 
I'm sure it would not be complex to import as plain text is quite a simple format.
 

Paul_J_Miller

2018/10/16 16:56

In reply to by Pierre_Admin

[quote=Pierre_Admin]
If you can wait, I can add a file importer
 
Pierre_Admin
IQ Designer
 
[/quote]
 
This feature will be of use to me in the long term so in that sense I can wait, but I also have an immediate need for this which could wait for a short while but if it is going to be too long I will change my strategy and do something different.
 
Do you have any idea of an approximate timescale ?
 
Sorry I don't want to put you under any pressure, please don't change your plans on my account but it would be useful to know an approximate timescale so I can change my plans now if necessary rather than later.
 

Pierre_Admin

2018/10/16 17:00

In reply to by Paul_J_Miller

I can probably include it in v110
 
It would however be imported as a regular Doc content, that is, become rich text
 
Plain-text document type will come later (with the possibility to convert rich-text to plain-text of course)
 
Pierre_Admin
IQ Designer
 

Paul_J_Miller

2018/10/16 17:03

In reply to by Pierre_Admin

Rich Text or HTML would be Wonderful!
 

Pierre_Admin

2018/10/16 17:09

In reply to by Paul_J_Miller

Consider it done... 
 
Can you see tags in grids now ? (v110Pre6)
 
Pierre_Admin
IQ Designer
 

Paul_J_Miller

2018/11/01 13:57

In reply to by Pierre_Admin

Is the text file import option still going to be developed ?
 
It would be quite useful.
 

Pierre_Admin

2018/11/01 14:00

In reply to by Paul_J_Miller

[quote=Paul_J_Miller]
Is the text file import option still going to be developed ?
[/quote]
Yes, I'm getting another pre-rel version out today which has a new copy format:
  • New: Grid: Edit > Copy > Copy as HTML Outline: Item and sub-items copied in a Print-ready style-based outline format, ready to paste in Rich Text editors. Option to set the base heading level and list type
And then I'll work on it :-)
 
HTH !
 
Pierre_Admin
IQ Designer
 

DragonGem

2018/10/15 14:07

In reply to by Paul_J_Miller

Be careful with this!! You are telling IQ to link directly to your Text Files so that any change you make in the Document Pane also changes the original Text Files.

This includes simply scrolling thru the grid to view each Document. When you return to a file that has already been viewed once, you will find that an HTML wrapper has been added to BOTH the displayed Document AND your original Text File!

Pierre's suggestion does work but you must perform those actions the first time you view each new Item.

Pierre_Admin

2018/10/15 14:55

In reply to by DragonGem

[quote=DragonGem]

Be careful with this!! You are telling IQ to link directly to your Text Files so that any change you make in the Document Pane also changes the original Text Files.

This includes simply scrolling thru the grid to view each Document. When you return to a file that has already been viewed once, you will find that an HTML wrapper has been added to BOTH the displayed Document AND your original Text File!

Pierre's suggestion does work but you must perform those actions the first time you view each new Item.

[/quote]
Thanks for reminding me to fix this. In v110Pre6, the Doc pane will not save the HTML version if the linked file is not an HTML file
 
HTH !
 
Pierre_Admin
IQ Designer
 

In v111:
  • New: File Import: Import plain text, html and rtf files. File name saved in the Item and content in the Doc pane ( FileRef fields are also filled)
 
HTH !
 
Pierre_Admin
IQ Designer
 

The text file import of v111a is much improved however there seems to be a bug.
 
If I import several files at once they all get the text from the first file to be imported in their document pane.  Double clicking on the item in the grid opens the correct file in the text editor (Notepad++) but the text in the document pane is the text from the first file to be imported.
 
However it is now recognising the line breaks correctly.
 
This one should be easy to reproduce and probably easy to fix as well.
 

Pierre_Admin

2018/11/24 15:25

In reply to by Paul_J_Miller

Hi Paul,
 
Fixed in v111b
 
In addition, Markdown files will automatically convert to HTML during the import. To keep using the markdown version, use file link instead of import
 
Pierre_Admin
IQ Designer
 

I just imported ~1500 small text files into my database using the File > Import From > Text Files function.  It worked beautifully, thanks!
 
The text is imported into the doc pane using the ItemHTML field.
 
Coming from the single-pane Ecco world, I prefer to put my own notes etc. into the grid - the Item field and other columns as appropriate.  I tend to reserve the HTML field for external-source documents which I want to keep together in their original form (i.e. a web page or a clipping).  Keeping my own notes in the grid enables me to use all the splitting / joining / rearranging / hoisting / expanding / collapsing tools of the outliner on my content.
 
For this reason, I think it would be great if we had an option, when importing from text files, to put the imported content into the Item field rather than the Doc Pane.  The file name could be the TLI, and the content could be put into the outline as subitems perhaps, splitting the text into items the same way as when multi-line text is pasted into a grid.