How do I extract cell content from openoffice spreadsheets (ods files)?
If I e.g. have a document myspreadsheet.ods and I want to extract the content of cell A1 in sheet1, how do I do that using a linux shell script?
How do I extract cell content from openoffice spreadsheets (ods files)?
If I e.g. have a document myspreadsheet.ods and I want to extract the content of cell A1 in sheet1, how do I do that using a linux shell script?
locoroco,
You can try first saving your ods file in format like csv within open calc, then you can extract cell values using awk as follow:
awk -F"," 'NR==1{print $1}' input.csv # Print "Cell 1,1=A1"
If you want to do all with shell script, googling I found that you can convert ods to csv installing "unoconv" utility, after that convert the ods file to csv for better handling sending the command
unoconv -f csv $FILE_TO_CONVERT_NAME.ods
reference: http://solidcode.com/about/evconv.txt
and the complete script could be something like this
unoconv -f csv $FILE_TO_CONVERT_NAME.ods | awk -F"," 'NR==1{print $1}' > Output
Hope it helps