Results 1 to 4 of 4
I am fairly new to Linux and need to bring some file information into a spreadsheet. I am trying to go through a directory and it's subdirectories, grab information from ...
- 05-21-2007 #1Just Joined!
- Join Date
- May 2007
- Posts
- 2
write file information to spreadsheet
I am fairly new to Linux and need to bring some file information into a spreadsheet. I am trying to go through a directory and it's subdirectories, grab information from all htm and html files, and write it to an open office spreadsheet. I would like to write the path (subdirectory), file name, title and description to their own columns.
I was able to get the path and file names of all files to a text file, but I have been unable to either filter for htm and html files or write to columns in a spreadsheet.
Any advice would be appreciated.
- 05-21-2007 #2
Which spreadsheet are you using?
As a test I just did this
ls -tora > list.txt
Then I opened the gnumeric spreadsheet and: File -> open -> list.txt
It separated the file into columns pretty natually, though there is also this, which I haven't tried:
Data -> Text to Columns...
- 05-21-2007 #3Just Joined!
- Join Date
- May 2007
- Posts
- 2
Thank you for your reply.
I am using the Open Office Calc spreadsheet.
I modified the ls -tora > list.txt command by changing .txt to .ods (the extension used by Open Office). The file produced opened with the Open Office Word Processor, even when I tried to open it from the spreadsheet application. I also added R to tora to get the contents of the subdirectories.
I need to filter for htm and html files. I would also like to grab some text from the contents orf the files, between <TITLE> and </TITLE>.
- 05-21-2007 #4
It sounds like you have two separate problems: parsing the data and importing the data.
For parsing the data, you may want to try something like this:As for importing text into OpenOffice Calc, copy the text into the clipboard and paste it into the spreadsheet. That causes a "Text Import" wizard to popup allowing you to select various things, like delimiters.Code:for f in $(find . -name *.html); do echo -n "$f "; sed -n 's#.*<\(title\|TITLE\)>\(.*\)</.*#\2#p' $f >> data.txt done


Reply With Quote