Find the answer to your Linux question:
Results 1 to 7 of 7
how to grep across xlsx file...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Mar 2012
    Posts
    1

    how to grep across xlsx file


    how to grep across xlsx file

  2. #2
    Linux Guru jmadero's Avatar
    Join Date
    Jul 2007
    Location
    California
    Posts
    1,991
    I don't think this is possible. Try converting it to a text file and then you should be able to use grep across it.
    Bodhi 1.3 & Bodhi 1.4 using E17
    Dell Studio 17, Intel Graphics card, 4 gigs of RAM, E17

    "The beauty in life can only be found by moving past the materialism which defines human nature and into the higher realm of thought and knowledge"

  3. #3
    Just Joined!
    Join Date
    Mar 2012
    Posts
    2
    Theoretically you can, it's just zipped xml fle.

    I've done a similar thing with .docx file in python, using archive and xml libraries You'll need to open the archive and then grep within that, whatever tool set you use.

  4. #4
    Just Joined!
    Join Date
    Oct 2005
    Location
    Mesquite TX USA
    Posts
    6
    xlsx files are zipped XML. Open the file with xarchiver or gunzip or some other utility. you now have a directory structure of XML files you can grep.

  5. #5
    Linux Enthusiast
    Join Date
    Jan 2005
    Location
    Saint Paul, MN
    Posts
    581
    You can look at Apache PIO (maybe POI) which will extract the information as text and then grep that output. Remember that grep can use standard in via a pipe.

  6. #6
    drl
    drl is offline
    Linux Engineer drl's Avatar
    Join Date
    Apr 2006
    Location
    Saint Paul, MN, USA / CentOS, Debian, Slackware, {Free, Open, Net}BSD, Solaris
    Posts
    1,258
    Hi.

    There is a very long bash script that is intended to convert an xlsx file to a csv file at xlsx2csv Excel xlsx (spreadsheetML) to CSV bash script (about half of the script is the GNU license text).

    I have downloaded and briefly looked at it, but have not tried it.

    It was pointed to from LQ link xlsx2csv Excel (xlsx) spreadsheetML to CSV converter - LinuxQuestions.org

    I posted this because once one unzips such a file, you have an XML file, which, although they are human-readable, are rarely human-understandable (at least by me). So if the intent is to use a standard tool like grep, you would then need to navigate your way through the XML markup. Assuming the converter works, one simply could use grep on the resulting non-XML, comma-separated-value text file.

    Best wishes ... cheers, drl
    Welcome - get the most out of the forum by reading forum basics and guidelines: click here.
    90% of questions can be answered by using man pages, Quick Search, Advanced Search, Google search, Wikipedia.
    We look forward to helping you with the challenge of the other 10%.
    ( Mn, 2.6.n, AMD-64 3000+, ASUS A8V Deluxe, 1 GB, SATA + IDE, Matrox G400 AGP )

  7. #7
    Linux Guru jmadero's Avatar
    Join Date
    Jul 2007
    Location
    California
    Posts
    1,991
    agree with drl, I have read it's possible with xml but the methods I read seemed overly complicated. In terms of csv file, you don't need any bash scripts. You can just do "save as" in OOo and select Text CSV at the bottom of the list
    Bodhi 1.3 & Bodhi 1.4 using E17
    Dell Studio 17, Intel Graphics card, 4 gigs of RAM, E17

    "The beauty in life can only be found by moving past the materialism which defines human nature and into the higher realm of thought and knowledge"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •